Search
Search quickstart
A first search, then one more field at a time until it is the search you want.
Copy as MarkdownOpen in ChatGPT (opens in a new tab)Open in Claude (opens in a new tab)
You need a key in MILLIONSHORT_API_KEY. The Quickstart gets you one in a minute, and the Free plan needs no card. Each step below is a complete request.
1. Search the web
curl https://api.millionshort.com/v1/search \
-H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "query": "restoring a cast iron skillet" }'import os
import requests
r = requests.post(
"https://api.millionshort.com/v1/search",
headers={"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"]},
json={
"query": "restoring a cast iron skillet"
},
timeout=30,
)
r.raise_for_status()
for hit in r.json()["data"]["results"]:
print(hit["position"], hit["title"], hit["url"])const res = await fetch('https://api.millionshort.com/v1/search', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MILLIONSHORT_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"query": "restoring a cast iron skillet"
}),
});
if (!res.ok) throw new Error(`POST /v1/search failed: ${res.status}`);
const { data } = (await res.json()) as {
data: { results: { position: number; title: string; url: string }[] };
};
for (const hit of data.results) console.log(hit.position, hit.title, hit.url);The same call as a tool of the MCP server:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search",
"arguments": {
"query": "restoring a cast iron skillet"
}
}
}With no sources, the search asks web. The answer is data.results: each result has a title, a url, a snippet, the source it came from, and the popularity and risk of its site. usage says what the call cost.
2. Leave out the most popular sites
curl https://api.millionshort.com/v1/search \
-H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "query": "restoring a cast iron skillet", "remove_top_sites": 10000 }'import os
import requests
r = requests.post(
"https://api.millionshort.com/v1/search",
headers={"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"]},
json={
"query": "restoring a cast iron skillet",
"remove_top_sites": 10000
},
timeout=30,
)
r.raise_for_status()
for hit in r.json()["data"]["results"]:
print(hit["position"], hit["title"], hit["url"])const res = await fetch('https://api.millionshort.com/v1/search', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MILLIONSHORT_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"query": "restoring a cast iron skillet",
"remove_top_sites": 10000
}),
});
if (!res.ok) throw new Error(`POST /v1/search failed: ${res.status}`);
const { data } = (await res.json()) as {
data: { results: { position: number; title: string; url: string }[] };
};
for (const hit of data.results) console.log(hit.position, hit.title, hit.url);The same call as a tool of the MCP server:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search",
"arguments": {
"query": "restoring a cast iron skillet",
"remove_top_sites": 10000
}
}
}The 10,000 most popular sites are gone from the list, and what is left is what usually sits beneath them. Remove top sites says how to choose the number.
3. Ask the specialists
curl https://api.millionshort.com/v1/search \
-H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "transformer interpretability",
"sources": ["web", "academic", "hn"],
"num_results": 20
}'import os
import requests
r = requests.post(
"https://api.millionshort.com/v1/search",
headers={"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"]},
json={
"query": "transformer interpretability",
"sources": [
"web",
"academic",
"hn"
],
"num_results": 20
},
timeout=30,
)
r.raise_for_status()
for hit in r.json()["data"]["results"]:
print(hit["position"], hit["title"], hit["url"])const res = await fetch('https://api.millionshort.com/v1/search', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MILLIONSHORT_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"query": "transformer interpretability",
"sources": [
"web",
"academic",
"hn"
],
"num_results": 20
}),
});
if (!res.ok) throw new Error(`POST /v1/search failed: ${res.status}`);
const { data } = (await res.json()) as {
data: { results: { position: number; title: string; url: string }[] };
};
for (const hit of data.results) console.log(hit.position, hit.title, hit.url);The same call as a tool of the MCP server:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search",
"arguments": {
"query": "transformer interpretability",
"sources": [
"web",
"academic",
"hn"
],
"num_results": 20
}
}
}Up to five sources in one call, merged into one list. Each source searched costs one credit.
4. Keep only the kinds of page you want
curl https://api.millionshort.com/v1/search \
-H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "rate limiting with a token bucket",
"page_types": ["tutorials", "documentation"]
}'import os
import requests
r = requests.post(
"https://api.millionshort.com/v1/search",
headers={"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"]},
json={
"query": "rate limiting with a token bucket",
"page_types": [
"tutorials",
"documentation"
]
},
timeout=30,
)
r.raise_for_status()
for hit in r.json()["data"]["results"]:
print(hit["position"], hit["title"], hit["url"])const res = await fetch('https://api.millionshort.com/v1/search', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MILLIONSHORT_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"query": "rate limiting with a token bucket",
"page_types": [
"tutorials",
"documentation"
]
}),
});
if (!res.ok) throw new Error(`POST /v1/search failed: ${res.status}`);
const { data } = (await res.json()) as {
data: { results: { position: number; title: string; url: string }[] };
};
for (const hit of data.results) console.log(hit.position, hit.title, hit.url);The same call as a tool of the MCP server:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search",
"arguments": {
"query": "rate limiting with a token bucket",
"page_types": [
"tutorials",
"documentation"
]
}
}
}Topics and page types lists the slugs. Filters are free and combine.
5. Get the passages, or the page
curl https://api.millionshort.com/v1/search \
-H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "sourdough starter hydration",
"num_results": 5,
"max_highlights": 3,
"include_content": true,
"max_characters": 4000
}'import os
import requests
r = requests.post(
"https://api.millionshort.com/v1/search",
headers={"Authorization": "Bearer " + os.environ["MILLIONSHORT_API_KEY"]},
json={
"query": "sourdough starter hydration",
"num_results": 5,
"max_highlights": 3,
"include_content": True,
"max_characters": 4000
},
timeout=30,
)
r.raise_for_status()
for hit in r.json()["data"]["results"]:
print(hit["position"], hit["title"], hit["url"])const res = await fetch('https://api.millionshort.com/v1/search', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MILLIONSHORT_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"query": "sourdough starter hydration",
"num_results": 5,
"max_highlights": 3,
"include_content": true,
"max_characters": 4000
}),
});
if (!res.ok) throw new Error(`POST /v1/search failed: ${res.status}`);
const { data } = (await res.json()) as {
data: { results: { position: number; title: string; url: string }[] };
};
for (const hit of data.results) console.log(hit.position, hit.title, hit.url);The same call as a tool of the MCP server:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search",
"arguments": {
"query": "sourdough starter hydration",
"num_results": 5,
"max_highlights": 3,
"include_content": true,
"max_characters": 4000
}
}
}max_highlights returns the passages of each result that best answer the query, free. include_content adds the page text we hold for web and news results, for 1 credit a call, which covers up to 10 results. See Highlights and page text.
Next
- Parameters: every field, and the whole response.
- Filters: all of them on one page, with recipes for agents.
- Guides: retrieval for a model, search as an agent's tool, long-tail research.
- MCP server: the same search as a tool, with no code.