Authentication
GNews API uses API keys for authentication. If you don't have an API key yet, you have to sign up first. Once you have created an account you will find your API key in your dashboard.
Get API keyYou can authenticate in two ways:
- With the
apikeyparameter in the query string- e.g., GEThttps://gnews.io/api/v4/{endpoint}?apikey=YOUR_API_KEY
- With the
X-Api-Keyheader
If the API key provided is invalid, you will receive a 401 - Unauthorized HTTP error. If the API key is not set at all,
or is malformed, you will receive a 400 - Bad Request HTTP error instead.
See Error Handling for the full list of status codes and error messages.