Authorization
API keys are created in My API after you sign up — no programmatic credentials are needed to create one. The endpoints below let you list and revoke your keys programmatically, authenticating with Authorization: Bearer <token> (the same key you use for data calls). > [!NOTE] > To create a new API key, open My API. Keys are passed to all data API calls either in the header (Authorization: Bearer <token>) or as a ?token=<token> query parameter.
Get an API key OpenAPI spec for AI assistants
Full API reference — quickstart, authentication, request limits and attribution.
API keys are created in My API after you sign up — no programmatic credentials are needed to create one. The endpoints below let you list and revoke your keys programmatically, authenticating with Authorization: Bearer <token> (the same key you use for data calls).
Note
To create a new API key, open My API. Keys are passed to all data API calls either in the header (Authorization: Bearer <token>) or as a ?token=<token> query parameter.
Endpoints
Keys
List your API keys (non-expiring tokens). Authenticate with your access token in the Authorization: Bearer <token> header.
/authorize/keyShell Curlcurl --request POST 'https://weatherapi.foreca.net/authorize/key' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'{
"tokens": [
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9mbnc2LmZvcmVjYS5jb21cL2F1dGhvcml6ZVwvdG9rZW4iLCJpYXQiOjE1MjYzMDAzODAsImV4cCI6MTUyNjMwMzk4MCwibmJmIjoxNTI2MzAwMzgwLCJqdGkiOiJxSXl3WVlQNjc1NkczejBEIiwic3ViIjoibFFHa1Y4Z2pIeGUyZU1ibndUUUs4NktqVTY3RXJlS2htenY1IiwicHJ2IjoiYWY3YTAzOThkZGNiNWE3YTUzN2Q3YzdkMjU2NWEyZjgxZGM4ZTQxNCJ9.V8xg6L9yrY9__VH-jdrL_CqXisEpgcfdUa0NoxlGz0k",
"key": "23j98rfsnldkvf3w49hg",
"label": "production server",
"expires_at": null
}
]
}{
"type": "object",
"properties": {
"tokens": {
"type": "array",
"items": {
"type": "object",
"properties": {
"access_token": {
"type": "string",
"example": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9mbnc2LmZvcmVjYS5jb21cL2F1dGhvcml6ZVwvdG9rZW4iLCJpYXQiOjE1MjYzMDAzODAsImV4cCI6MTUyNjMwMzk4MCwibmJmIjoxNTI2MzAwMzgwLCJqdGkiOiJxSXl3WVlQNjc1NkczejBEIiwic3ViIjoibFFHa1Y4Z2pIeGUyZU1ibndUUUs4NktqVTY3RXJlS2htenY1IiwicHJ2IjoiYWY3YTAzOThkZGNiNWE3YTUzN2Q3YzdkMjU2NWEyZjgxZGM4ZTQxNCJ9.V8xg6L9yrY9__VH-jdrL_CqXisEpgcfdUa0NoxlGz0k"
},
"key": {
"type": "string",
"example": "23j98rfsnldkvf3w49hg"
},
"label": {
"type": "string",
"example": "production server"
},
"expires_at": {
"type": "string",
"nullable": true
}
}
}
}
}
}Delete Key
Revoke an API key using its key id (the key field returned by the list endpoint). Authenticate with your access token in the Authorization: Bearer <token> header.
Path Parameters
keyType: stringrequiredThe key id of the API key to revoke (the key field from the list endpoint).
/authorize/key/{key}Shell Curlcurl --request DELETE 'https://weatherapi.foreca.net/authorize/key/{key}' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'