Account and privacy

Is there an API?

Yes. Create a token in Account settings and read your sites, plans and keywords, or start research, from your own tools. Tokens act as you and spend your credits.

The API gives you everything the app shows, as JSON, plus the ability to add a site and start research.

Getting a token

  1. Open Account settings and find API.
  2. Name the token after the tool that will use it and press Create Token.
  3. Copy it. It is shown once; we store only a fingerprint. Revoke it from the same place if it leaks.

Send it on every request as a header: Authorization: Bearer lk_.... A token acts as you: anything it starts is charged to your credits, and it can only see your own sites.

Endpoints

All under https://legiitkeywords.com/api/v1. Responses are JSON; errors come back as {"error": "..."} with a 4xx status.

Method and path What it does
GET /me Your email and credit balance.
GET /sites Every site on the account, with its client name.
POST /sites Add a live site: {"url": "example.com", "name": "…", "market": "US", "client": "…"}. Reads the free profile straight away.
GET /sites/{id} One site and its recent runs.
POST /sites/{id}/research Start the research: {"deep": false, "seeds": ["…"]}. Costs credits like the app. Returns the run id; poll it.
GET /runs/{id} Where a run is: queued, running (with the stage), succeeded, failed.
GET /sites/{id}/plan The page decisions of the latest finished research: action, title, verdicts, work items, status and published URL. Add ?run={id} for an older run. A locked trial plan returns only the revealed decision, with run.locked true and run.locked_decisions saying how many wait.
GET /sites/{id}/keywords Every keyword with its status, volume, evidence and cluster. Add ?status=kept to skip the ones set aside. While a trial plan is locked, only the revealed decision's keywords, with run.locked true.

A worked example:

curl -H "Authorization: Bearer lk_..." https://legiitkeywords.com/api/v1/sites
curl -X POST -H "Authorization: Bearer lk_..." -H "Content-Type: application/json" \
  -d '{"deep": false}' https://legiitkeywords.com/api/v1/sites/SITE_ID/research

Limits

Ten active tokens per account. Research started through the API obeys the same rule as the app: two runs in progress per account at a time. Please poll a run no more often than every 30 seconds; a run takes 15 to 25 minutes.

Was this helpful?

Still stuck?

Tell us what you were trying to do and which site or page it concerns. A person replies from help@legiit.com, usually within one business day.