# Clay

MillionShort search as a step in Clay, with one call to the API.

Recipe · An HTTP step · Key in a form field · Checked 2026-11-19

> **For agents.** Read the API key from the `MILLIONSHORT_API_KEY` environment variable. Never print it; where a client needs it in a settings file, use a file that is not committed.
> The MCP address is https://mcp.millionshort.com/mcp (streamable HTTP; send `Authorization: Bearer <key>`, or no header for the no-key mode).
> On `INSUFFICIENT_CREDITS` stop and ask a person; on `RATE_LIMITED` or `CAPACITY` wait the `Retry-After` seconds, then retry once.
> Set-up steps written for agents: https://millionshort.com/docs/auth.md. Every integration: https://millionshort.com/docs/integrations.md.

## 1. Call the API in an HTTP step

1. In a table, **Add enrichment**, **HTTP API**.
2. Save the key once as a header account: **Select header account**, **+ Add account**, header `Authorization` with the value `Bearer ms-YOUR_API_KEY`. Clay keeps it encrypted for the workspace; a key typed into the column's headers is visible to anyone with the table.
3. On **Configure**: method **POST**, endpoint `https://api.millionshort.com/v1/search`, and a JSON body. Type `/` to insert a column, such as a company name, as the query:

```json JSON body
{"query": "/Company Name reviews", "remove_top_sites": 1000, "num_results": 5}
```

## 2. Try it

Ask Clay's agent, or run the step with this as the query:

> Search MillionShort for forum threads about restoring a cast iron skillet, with the 1,000 most popular sites removed. List the five most useful with their links.

A good answer comes from a `search` call (the client shows the tool call) and links to pages you may not have seen before.

## 3. Tell it when to search

Clay has no search of its own in this column, so say which search to use.

If an AI column reads the results, tell it:

> Use the MillionShort `search` tool for anything recent, niche, or that needs a source. To reach lesser-known sites, set `remove_top_sites` (for example 1000). Cite the URLs it returns.

## 4. Check it works

**Test** runs it on one row: the response has `data.results`.

A search that worked returns `data.results`, each with a `title`, a `url` and a `snippet`, and `usage.credits`: what it cost.

## Tools

| Tool | What it does | Without a key | Cost |
|---|---|---|---|
| `search` | Searches the web and the specialist sources, with the popularity, domain, page-type, topic, site and date filters | Yes: one source, up to 5 results | 1 credit per source searched, first 10 results |
| `get_domain_info` | Popularity and risk for up to 25 sites | No | 1 credit |
| `list_sources` | The sources, page types and topics `search` accepts | Yes: source names | Free |
| The tools of the other endpoints | `extract`, `map`, `crawl`, `places` and more: [the MCP page](https://millionshort.com/docs/mcp#tools) lists them | A few, such as `places` | What the API call behind each costs |

## Costs and limits

A tool call costs what the API call behind it costs: 1 credit per source searched for the first 10 results, 1 credit for a domain lookup, nothing for the list of sources, the price of the endpoint for the other tools, and nothing at all in the no-key mode. An agent that loops can make many calls: give it a step limit, and ask for fewer results when a few will do. [Credits and limits](https://millionshort.com/docs/credits-and-limits) has the numbers.

## When it fails

| What you see | Why | Fix |
|---|---|---|
| `401 AUTH_MISSING_KEY` or `AUTH_INVALID_KEY` | The key is missing or wrong | Set `MILLIONSHORT_API_KEY`; keys start with `ms-` |
| `400 INVALID_PARAM` | A field name or value the API does not take | The `message` names the field; the [search reference](https://millionshort.com/docs/search/parameters) lists them all |
| `429 RATE_LIMITED` or `CAPACITY` | Too many calls a minute, or no free capacity right now | Wait the `Retry-After` seconds, then retry |
| `429 INSUFFICIENT_CREDITS` | The plan's credits are used up | Stop and add credits; do not retry |

## Related

- [MCP server](https://millionshort.com/docs/mcp): the address, every tool, and what the no-key mode allows.
- [Filters for agents](https://millionshort.com/docs/search/filters): what to ask `search` for, with recipes.
- More low-code builders: [n8n](https://millionshort.com/docs/integrations/n8n), [Zapier](https://millionshort.com/docs/integrations/zapier), [Make](https://millionshort.com/docs/integrations/make), [Dify](https://millionshort.com/docs/integrations/dify), and [every integration](https://millionshort.com/docs/integrations).
- Clay's own documentation, read on 2026-11-19: [HTTP API integration](https://university.clay.com/docs/http-api-integration-overview).
