Skip to content

Quickstart

This page takes you from zero to your first answer: create an API key → list available platforms → submit a question → poll for the result → read the answer. All you need is a terminal.

  1. Sign in to the Developer Console, open API Keys, and click Create API key. Give it a name (for example, “Local testing”) and pick an expiration.

    Once it’s created, a dialog shows the full key — a string that starts with gdev_. The full key is shown only once. Copy it and store it in an environment variable:

    Terminal window
    export MAXAEO_API_KEY="gdev_your_full_key"

    For everything else you can do with keys, see Manage API Keys.

  2. Start with the simplest request to confirm the key works and get each platform’s ID and price:

    Terminal window
    curl -X POST "https://maxaeo.ai/geoapi/geodata/developer/platforms/get" \
    -H "Authorization: Bearer $MAXAEO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{}'

    Response (excerpt):

    {
    "ret": 1,
    "data": {
    "ent": {
    "platforms": ["chatgpt", "gemini", "claude", "perplexity", "…"],
    "items": [
    {
    "platform": "chatgpt",
    "region": "overseas",
    "platform_status": "normal",
    "p1_credits": 12,
    "p2_credits": 6,
    "has_stats": true,
    "success_rate": 0.95,
    "p50_duration_seconds": 58,
    "sample_count": 112,
    "stats_updated_at": 1793018400
    }
    ]
    }
    }
    }

    ret equal to 1 means success. When you submit a task, set platform to one of the IDs in platforms (platforms whose platform_status is maintenance aren’t accepting tasks). p1_credits / p2_credits are the credits charged per successful call at each priority tier (the numbers above are illustrative — rely on the live response).

    If you get {"ret":1030, …}, the key is invalid. Check that the environment variable holds the full key and that the key hasn’t been disabled — see Authentication.

  3. Ask ChatGPT a question. If you omit priority, the task runs and is billed at P2 Standard:

    Terminal window
    curl -X POST "https://maxaeo.ai/geoapi/geodata/developer/task/submit" \
    -H "Authorization: Bearer $MAXAEO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"platform": "chatgpt", "query": "best mechanical keyboards for programmers"}'

    The endpoint returns the task right away, with status queued:

    {
    "ret": 1,
    "data": {
    "ent": {
    "task_id": "task_3f6c1d2e-8a4b-4c1f-9e2d-7b5a0c9d1e23",
    "platform": "chatgpt",
    "query": "best mechanical keyboards for programmers",
    "status": "queued",
    "priority": 2,
    "credits": 6,
    "…": "…"
    }
    }
    }

    Save the task_id. At this point credits is the reserved amount: it’s only charged if the task succeeds, and released if it fails or is canceled.

  4. Check every 15 seconds until status becomes succeeded, failed, or canceled:

    Terminal window
    curl -X POST "https://maxaeo.ai/geoapi/geodata/developer/task/get" \
    -H "Authorization: Bearer $MAXAEO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"task_id": "task_3f6c1d2e-8a4b-4c1f-9e2d-7b5a0c9d1e23"}'

    Fetching the answer itself usually takes tens of seconds to two minutes, plus queue time; it can take longer when a platform is busy. The intermediate statuses dispatching, pending, and running are all normal — just keep polling. See Task Lifecycle.

  5. Once the task succeeds, the response contains:

    • answer: the AI’s raw answer (Markdown), with the platform’s own citation markers preserved.
    • raw_result.references: the cited sources; cited: true means the answer text actually cites that source.
    • share_link: the platform’s share link (empty if the platform doesn’t provide one).
    • credits: the credits actually charged.

    Field definitions are in The Task Object; parsing tips are in Working with Results.

The scripts below chain submit, poll, and read together. The API key is read from the MAXAEO_API_KEY environment variable.

quickstart.py
import os
import time
import requests
BASE_URL = "https://maxaeo.ai/geoapi/geodata/developer"
HEADERS = {"Authorization": f"Bearer {os.environ['MAXAEO_API_KEY']}"}
TERMINAL = ("succeeded", "failed", "canceled")
def call(path, body):
resp = requests.post(BASE_URL + path, headers=HEADERS, json=body, timeout=30)
resp.raise_for_status()
data = resp.json()
if data["ret"] != 1:
raise RuntimeError(f"ret={data['ret']}: {data.get('msg')}")
return data["data"]["ent"]
task = call("/task/submit", {"platform": "chatgpt", "query": "best mechanical keyboards for programmers"})
print("Submitted", task["task_id"])
while task["status"] not in TERMINAL:
time.sleep(15)
task = call("/task/get", {"task_id": task["task_id"]})
print("Status", task["status"])
if task["status"] == "succeeded":
print(task["answer"])
for ref in (task.get("raw_result") or {}).get("references", []):
if ref.get("cited") is True:
print(ref.get("rank"), ref.get("title"), ref.get("url"))
print("Credits charged", task["credits"])
else:
print("Task did not succeed", task["error_code"], task["error_message"])

Run it: pip install requests && python quickstart.py