Menu

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

Example
Shell
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" }'

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.

Example
Shell
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 }'

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

Example
Shell
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
  }'

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

Example
Shell
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"]
  }'

Topics and page types lists the slugs. Filters are free and combine.

5. Get the passages, or the page

Example
Shell
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
  }'

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

This page as Markdown ยท llms.txt