AnswerLine Start free

Docs /

Quickstart

1. Get an API key

Sign in to the dashboard and create a key on the API keys page. The key is shown once, so store it as a secret. Every new account gets 100 free requests, usable on any live engine, ChatGPT in this guide included; after that, requests are paid from a balance you top up on the Billing page.

export API_KEY=sk_...

Install an SDK, or skip this and use curl. The TypeScript SDK runs on Node 18+, Deno, Bun and browsers; the Python SDK needs Python 3.10+.

npm install @answerline/sdk

2. Make a synchronous call

A monitor endpoint waits for the engine's answer and returns it in the response. Pass your API base URL, https://api.answerline.dev, to the SDK client.

curl -X POST "https://api.answerline.dev/v1/monitor/chatgpt" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"iPhone 17 or Galaxy S26?","country":"US","include":{"markdown":true}}'

The response is {"success": true, "result": {…}}; the fields of result are listed on each engine's page, for example ChatGPT. A synchronous call can take up to ten minutes ($0.0015 for this one at Starter), and stays open until the engine answers.

3. Target a market

Set country (ISO 3166-1 alpha-2) on every request, or a US state, which implies the US: ChatGPT and Gemini answer from inside the state, every other engine for the whole US (states). Google Search, Google News and AI Mode add hl for the interface language, and Google Search and AI Mode take a city in location or uule; the API reference lists each engine's request options. List the countries an engine supports and the US states:

curl -X GET "https://api.answerline.dev/v1/countries?model=chatgpt" \
  -H "Authorization: Bearer $API_KEY"

curl -X GET "https://api.answerline.dev/v1/states?country=US" \
  -H "Authorization: Bearer $API_KEY"

4. Queue a task and poll

An async task runs the same request in the background and answers at once with the task's id. Higher-priority tasks start first, and tasks cost the same as a synchronous call. An idempotencyKey makes creating the task safe to repeat.

curl -X POST "https://api.answerline.dev/v1/async/task" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"taskType":"CHATGPT","payload":{"prompt":"iPhone 17 or Galaxy S26?","country":"US"},"idempotencyKey":"iphone-galaxy-us-2026-09-15"}'

curl -X GET "https://api.answerline.dev/v1/async/task/$TASK_ID" \
  -H "Authorization: Bearer $API_KEY"

A task moves from QUEUED to PROCESSING to COMPLETED or FAILED. Once it has finished, response holds the engine's result or the error. waitForTask and wait_for_task poll with backoff for up to 16 minutes by default.

5. Receive results by webhook

Add a webhook URL and the finished task is sent to it, signed with your account's secret, so you don't have to poll. The URL must use https and resolve to a public address. Verify each delivery as the webhooks guide shows before trusting it.

curl -X POST "https://api.answerline.dev/v1/async/task" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"taskType":"CHATGPT","payload":{"prompt":"iPhone 17 or Galaxy S26?","country":"US"},"webhook":{"url":"https://your-app.com/hooks/answers"}}'

Next steps