My API key is invalid / I get a 401 error

The most common cause: NewsAPI.ai is not newsapi.org. They are two different companies. If your code calls newsapi.org (e.g. https://newsapi.org/v2/top-headlines or /v2/everything), our key won't work there - the error "Your API key is invalid or incorrect. Check your key, or go to https://newsapi.org" comes from newsapi.org. Also, if you were charged by newsapi.org, you need to contact them.

Our API is called at https://eventregistry.org/api/v1/... (e.g. https://eventregistry.org/api/v1/article/getArticles). Other checks:

  • "User is not logged in" means no API key was received: send it as apiKey in the JSON body (or as a URL parameter in GET requests), not as an X-Api-Key header.
  • Copy the key exactly as shown on your dashboard, including the dashes. If you generated a new key, the old one no longer works.
  • Build an example in the sandbox (newsapi.ai/documentation/sandbox) and compare it with your request.
  • Integration tools such as n8n may have a built-in "NewsAPI" node - that one is for newsapi.org. Use a generic HTTP request node instead.

If it still doesn't work, send us the full request (with the key removed) and your account email at [email protected].