Reference
API reference
The base address, the shape of every request and response, and where each endpoint's fields are listed.
Copy as MarkdownOpen in ChatGPT (opens in a new tab)Open in Claude (opens in a new tab)
https://api.millionshort.comThe API is JSON over HTTPS. Every path starts with /v1. This is version 1.0.0.
Endpoints
| Endpoint | What it does | Credits |
|---|---|---|
POST /v1/search | Search one to five sources and get one ranked list | 1 per source, plus 0.5 per 10 results after the first 10 |
GET /v1/sources | The sources, page types and topics a search accepts | Free |
POST /v1/domain | Popularity and risk for up to 25 sites | 1 per call |
POST /v1/keys/agent | A short-lived trial key for an agent. Needs no key | Free |
The fields of an endpoint are listed on the Parameters page of its own section: Search, Extract, Monitor, Map, Crawl, Places, Agent.
The other endpoints and building blocks, each described with its section:
| Endpoint | What it does |
|---|---|
POST /v1/extract | A page as clean text |
POST /v1/extract/batch | The same for up to 1,000 pages, as a job |
/v1/monitors | Watch a search or a page and be told what changed |
/v1/webhooks | Where monitors, batches, crawls and agent runs deliver events |
/v1/spaces | Saved scopes for search: create, list, read, change, delete and import. Free |
space on POST /v1/search | Search with a saved scope |
POST /v1/map | The URLs of a site, from its sitemaps, its links and our index |
POST /v1/crawl | A site's pages as clean text, as a job: start, poll, list and cancel |
POST /v1/places | Businesses and points of interest by what they are and where, as data |
POST /v1/agent | A question in, an answer with a checked quote for every statement out, as a job you start and then poll |
The endpoints has all six at a glance.
openapi.json is the machine-readable description of the four endpoints in the first table. The others are described field by field on their Parameters pages.
Authentication
Send your key as a bearer token on every call:
curl https://api.millionshort.com/v1/sources \
-H "Authorization: Bearer $MILLIONSHORT_API_KEY"import os
import requests
r = requests.get(
"https://api.millionshort.com/v1/sources",
headers={"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"]},
timeout=30,
)
r.raise_for_status()
print(r.json()["data"])const res = await fetch('https://api.millionshort.com/v1/sources', {
headers: { Authorization: `Bearer ${process.env.MILLIONSHORT_API_KEY}` },
});
if (!res.ok) throw new Error(`GET /v1/sources failed: ${res.status}`);
const { data } = (await res.json()) as { data: unknown };
console.log(data);The same call as a tool of the MCP server:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_sources",
"arguments": {}
}
}Keys start with ms-. Authentication covers creating and revoking keys, the trial key, and what works with no key.
Requests
POSTbodies are JSON, withContent-Type: application/json.- A field the endpoint does not list is refused with
400 INVALID_PARAM. A typo in a field name is an error, not a silent default. - A field you leave out takes the default shown in the endpoint's table.
- Calls are synchronous: the answer to a search is the response to the request.
- A search changes nothing, so sending it again after a failure is always safe.
Responses
Every success has the same four parts:
{
"data": { "sources": [], "page_types": [], "topics": [] },
"usage": { "credits": 0, "cost_usd": 0, "breakdown": { "sources": 0 } },
"warnings": [],
"request_id": "req_..."
}| Part | What it is |
|---|---|
data | The answer. Its shape depends on the endpoint |
usage | What the call cost: credits, cost_usd, and a breakdown by line item |
warnings | Notices that did not fail the call, each with a code and a message |
request_id | Identifies the call. Quote it when you contact us |
The SDKs unwrap data: results and summary sit directly on the object a search returns, with usage, warnings and the request id beside them.
Every failure has one shape too, with a stable code to branch on:
{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests. Try again in 12 seconds.",
"retry_after_seconds": 12,
"details": {}
},
"request_id": "req_..."
}Errors lists every code and says which to retry. A call that ends in an error is never charged.
Status codes
| Status | Meaning |
|---|---|
200 | Success. Read warnings as well as data |
400 | The request is wrong: INVALID_PARAM or UNSUPPORTED_OPTION. Do not retry it unchanged |
401 | No key, or a key that is malformed, revoked or expired |
403 | Dashboard sign-up only (ACCOUNT_NOT_ELIGIBLE). Not returned by /v1 calls |
404 | No such endpoint or resource |
429 | RATE_LIMITED or CAPACITY: wait Retry-After seconds. INSUFFICIENT_CREDITS: add credits |
500 | Our fault. Retry with a growing pause |
502 | SEARCH_UNAVAILABLE: search could not be served right now. Retry after Retry-After seconds |
Headers
Every /v1 response that passed the rate limiter carries these headers:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Requests allowed per minute |
X-RateLimit-Remaining | Requests left in the current window |
X-RateLimit-Reset | Unix time at which the window is full again |
Retry-After | On a 429 or a 502: seconds to wait before sending the call again |
Credits and limits has each plan's numbers.
Credits
One credit is $0.001. Each endpoint's page says what a call costs, every response says what it did cost in usage, and a call that fails costs nothing. Credits and limits has the rules and worked examples.
Clients
- Python SDK and TypeScript SDK: thin clients, one method per endpoint. Not published to a package registry yet.
- MCP server: the same endpoints as tools, for any MCP client.
- LangChain and Vercel AI SDK tool packages. Not published yet.
- Anything that can send an HTTPS request.
Call the API from a server. Do not put a key in code that runs in a browser or a mobile app.