How to Use Returned Status Codes#
All submission methods return the status code of the response, e.g. 200 for success, 202 for accepted, 400 for bad request, etc.
This can be useful if you want to know if the URLs or sitemaps were submitted successfully to the IndexNow API.
Example of Status Code as Condition#
Before submitting all URLs, you can test if the first URL was submitted successfully and herafter continue with the rest of the URLs. A variation of previous examples:
| Python | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Overview of Status Codes#
According to the IndexNow API documentation and this package, the following status codes are typically returned:
Typical Status Codes
| Code | Response | Β Description |
|---|---|---|
200 | OK | Β URL submitted successfully. |
202 | Accepted | URL received. IndexNow key validation pending. |
204 | No content | No URLs found in sitemap or no URLs left after filtering. |
400 | Bad request | The request was invalid. |
403 | Forbidden | In case of key not valid (e.g. key not found, file found but key not in the file). |
422 | Unprocessable entity | In case of URLs which donβt belong to the host or the key is not matching the schema in the protocol. |
429 | Too many requests | Too many requests (potential spam). |
If you get 500 or similar as status code, it's likely that the server is experiencing an error. Then try again later.