API Quickstart

Example search for Tesla stock outlook

Making your first request with the Athena API is straightforward with this script.

Athena's News API operates asynchronously — meaning that when you are submitting your query, a job is created (along with a unique job id). You'll then have to poll the get-results endpoint with that job id to see if your job is done.

  • Submit query and get a query id

  • Every x seconds poll the get-results endpoint to see if the query is finished, passing in the query id from the previous step

  • If the search is complete, your results will be returned

Using Async Query Endpoint

First define your ATHENA_API_KEY. The payload dictionary specifies the query parameters, including a search term ("donald trump"), your api_key, other configuration details to filter the results (for the sake of simplicity we are choosing to omit extra parameters — see API Reference for other options).

The initial request is sent via a POST call to Athena’s query-async API endpoint. The response contains your query_id, which is how you will retrieve results from your search with the /api/v2/get-results endpoint.

Last updated