API Status Codes
As we know Status code tells us about what happened with our request, whether it was successfully executed or other was some error while processing it. They are returned with every request we place.
Codes related to “GET” request:
- 200 OK: The server successfully processed the request, and the requested data is returned.
- 201 Created: A new resource is created on the server as a result of the request.
- 204 No Content: The request is successful, but there is no additional data to return.
- 300 Multiple Choices: The requested resource has multiple representations, each with its own URL.
- 302 Found (Temporary Redirect): The requested resource is temporarily located at a different URL.
- 304 Not Modified: The client’s cached copy of the resource is still valid, and no re-download is necessary.
- 400 Bad Request: The request has malformed syntax or contains invalid data, making it incomprehensible to the server.
- 401 Unauthorized: Authentication is required, and the client’s credentials (e.g., API key) are missing or invalid.
- 500 Internal Server Error: An unexpected server error occurred during request processing.
- 502 Bad Gateway: Acting as a gateway or proxy, the server received an invalid response from an upstream server.
These status codes help communicate the outcome of API requests and guide developers and clients in understanding the results, errors, or necessary actions.
Python API Tutorial: Getting Started with APIs
In this article, we will learn about how Python API is used to retrieve data from various sources. Also, we will cover all concepts related to Python API from basic to advanced. Various websites provide weather data, Twitter provides data for research purposes, and stock market websites provide data for share prices.
Table of Content
- What is an API?
- Making API Requests in Python
- API Status Codes
- API Documentation
- Working with JSON Data
- Using API with Query
- Getting Started With API Key
- Reasons to use API
- Conclusion