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

  1. Visit Free API Hub and register an account
  2. Log in and go to the dashboard
  3. Create a new Key in the API Key management page
  4. 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 CodeMeaningDescription
200OKRequest successful
400Bad RequestInvalid request parameters
401UnauthorizedInvalid or missing API Key
403ForbiddenInsufficient permissions or quota exceeded
404Not FoundResource not found
429Too Many RequestsToo many requests, please try again later
500Internal Server ErrorInternal server error