API Documentation
Complete API documentation for Free API Hub, including authentication, code examples, response formats, and more. Quickly integrate free APIs into your application.
API URL
https://api.524900.xyz
Auth Method
X-API-Key Header
Daily Quota
Unlimited
Authentication
Free API Hub uses API Key for authentication. You need to include the X-API-Key field in the HTTP header of every request, with your API Key as the value.
Get API Key
- Visit Free API Hub and register an account
- Log in and go to the dashboard
- Create a new Key in the API Key management page
- Copy and securely save the generated Key
Security Notice:Do not expose your API Key to others or store it in plain text in client-side code. It is recommended to store the API Key in backend environment variables.
Code Examples
Weather Query
Query real-time weather and forecasts by city name
curl
curl -X GET "https://api.524900.xyz/weather?city=北京" -H "X-API-Key: YOUR_API_KEY"QR Code Generation
Generate QR code images from links or text
curl
curl -X POST "https://api.524900.xyz/qrcode" -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{"text": "https://524900.xyz", "size": 300}'Random Joke
Get a random fun joke
curl
curl -X GET "https://api.524900.xyz/jokes/random" -H "X-API-Key: YOUR_API_KEY"Response Format
Success Response
JSON
{
"success": true,
"code": 200,
"data": {
// 具体业务数据
},
"message": "Request successful"
}Error Response
JSON
{
"success": false,
"code": 401,
"error": "unauthorized",
"message": "Invalid API Key, please check your authentication"
}Common HTTP Status Codes
| Status Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request successful |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Invalid or missing API Key |
| 403 | Forbidden | Insufficient permissions or quota exceeded |
| 404 | Not Found | Resource not found |
| 429 | Too Many Requests | Too many requests, please try again later |
| 500 | Internal Server Error | Internal server error |