Developer Documentation
Everything you need to integrate Free API Hub into your application. Quick start, code examples, authentication, and error handling.
Quick Start
Three steps to start using Free API Hub.
1
Register an Account
Sign up with your email and password to create a free account.
2
Get Your API Key
Create an API Key in the developer dashboard.
3
Call the API
Add the API Key to the request header to start calling APIs.
API Call Examples
Use the X-API-Key header to authenticate your requests. Below are examples in cURL, JavaScript, and Python.
cURL
curl -X GET "https://api.524900.xyz/v1/weather?city=beijing" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" JavaScript
const res = await fetch("https://api.524900.xyz/v1/weather?city=beijing", {
headers: {
"X-API-Key": "your_api_key_here",
"Content-Type": "application/json",
},
});
const data = await res.json();
console.log(data); Python
import requests
response = requests.get(
"https://api.524900.xyz/v1/weather",
params={"city": "beijing"},
headers={
"X-API-Key": "your_api_key_here",
"Content-Type": "application/json",
},
)
print(response.json()) Authentication
Free API Hub uses API Key based authentication. After registering and logging in, generate your API Key in the developer dashboard, then pass it in the X-API-Key request header with every call.
- API Key is generated in the developer dashboard.
- Pass it via the X-API-Key header on every request.
- Keep your API Key secure; do not expose it in client-side code.
header
X-API-Key: your_api_key_here
Content-Type: application/json Error Codes
Common HTTP status codes returned by the API.
| Status Code | Description |
|---|---|
| 200 | Request successful |
| 400 | Bad request - invalid parameters |
| 401 | Unauthorized - invalid or missing API Key |
| 403 | Forbidden - access denied |
| 404 | Not Found - resource does not exist |
| 429 | Too Many Requests - rate limit exceeded |
| 500 | Internal Server Error |