Your account · every product
Use with AI agents
Give an AI agent the API: connect the MCP server, or hand it the command-line tool or a package, and a prompt that tells it how runs, records, statuses and units work.
An AI agent can use EnrichedNow in three ways: as tools, through the hosted MCP server; from a shell, with the command-line tool; or in code it writes, with a package or plain HTTP. This page has the set-up for each, and a prompt that tells an agent how runs, records, statuses and units work.
| The agent | Give it |
|---|---|
| Takes MCP servers — Claude Code, Cursor, VS Code, Codex | The MCP server |
| Has a shell | The command-line tool |
| Writes code | A package, and the prompt |
| Reads documentation | The files below |
What an agent can read#
This site is written for programs as well as for people:
https://docs.enrichednow.com/llms.txt | The index: every page of this site with one line on what it is, and the addresses an agent needs. |
https://docs.enrichednow.com/llms-full.txt | Every page, whole, in one Markdown file. |
https://docs.enrichednow.com/quickstart.md | Any page as Markdown: its address with .md added. A scraper's page is https://docs.enrichednow.com/scrapers/<id>.md. |
https://api.enrichednow.com/v1/openapi.json | The API's OpenAPI description. |
https://api.enrichednow.com/v1/scrapers | The scrapers as JSON, and /v1/scrapers/<id> one scraper with the JSON Schema of its input. No key needed. |
All of them are generated from what the pages are generated from, so they say what the pages say. What changed and when is in the changelog.
Give the agent a key#
Whichever way the agent connects, it uses an API key. Create one in the console, under API keys — see Authentication — and give the agent a key of its own, so that you can revoke it without stopping anything else. The examples on this page read it from the environment:
export ENRICHEDNOW_API_KEY="en_live_..."The key can do everything your account can do with the API, and spend its units. Keep it in the environment or in the client's own store, not in a file that is committed.
Connect the MCP server#
One address gives an agent the API as tools. There is nothing to install.
| Address | https://api.enrichednow.com/mcp |
| Transport | Streamable HTTP |
| Authentication | The API key, in the header Authorization: Bearer <key> |
A client that can sign in needs the address only: Sign in, with no key. Each client below is given the same two things, the address and the header.
Claude Code#
claude mcp add --transport http enrichednow https://api.enrichednow.com/mcp \
--header "Authorization: Bearer $ENRICHEDNOW_API_KEY"That adds the server for you, in the current project; --scope user adds it in every project. To share it with a
team, put this in a .mcp.json file at the root of the project instead. The key stays in each person's environment:
{
"mcpServers": {
"enrichednow": {
"type": "http",
"url": "https://api.enrichednow.com/mcp",
"headers": {
"Authorization": "Bearer ${ENRICHEDNOW_API_KEY}"
}
}
}
}Inside Claude Code, /mcp shows whether the server is connected.
Cursor#
Put this in ~/.cursor/mcp.json to have the server everywhere, or in .cursor/mcp.json inside one project. Cursor
writes an environment variable as ${env:NAME}:
{
"mcpServers": {
"enrichednow": {
"url": "https://api.enrichednow.com/mcp",
"headers": {
"Authorization": "Bearer ${env:ENRICHEDNOW_API_KEY}"
}
}
}
}VS Code#
VS Code reads the same .mcp.json file at the root of the workspace that Claude Code reads, so one file serves
both. For every workspace, put it in ~/.copilot/mcp-config.json:
{
"mcpServers": {
"enrichednow": {
"type": "http",
"url": "https://api.enrichednow.com/mcp",
"headers": {
"Authorization": "Bearer ${ENRICHEDNOW_API_KEY}"
}
}
}
}The variable must be set where VS Code is started, and written with its braces. The older .vscode/mcp.json file,
which asks for the key and keeps it, still works: MCP server has it.
Codex#
Add a table to ~/.codex/config.toml. Codex reads the key from the variable you name and sends it as the bearer
token:
[mcp_servers.enrichednow]
url = "https://api.enrichednow.com/mcp"
bearer_token_env_var = "ENRICHEDNOW_API_KEY"Other clients#
Any client that speaks Streamable HTTP and can send a header will do: give it the address and
Authorization: Bearer <key>. Claude Desktop and claude.ai, and what to check when a client does not connect, are
on the MCP server page.
The tools an agent gets#
First the playbook tools: a playbook is a ready-made workflow that returns a finished list, and the server
tells the agent to prefer one when a request takes several steps. Their names keep the API's word for a playbook,
formula.
| Tool | What it does | Costs |
|---|---|---|
list_formulas | Finds the playbook for a request in plain words, best match first, with the questions it asks. | Nothing |
get_formula | One playbook: its parameters, presets, columns, caps, what a typical run costs, and a few sample rows. | Nothing |
estimate_formula | What a run with these answers would cost. | Nothing |
run_formula | Runs a playbook or a saved playbook: a preview unless told otherwise, and a full run only with a unit cap. Waits up to 50 seconds. | Units, as the run works |
get_formula_run | One playbook run: its status, its reason and the fix. | Nothing |
get_formula_rows | A page of a run's rows, or of a saved playbook's rows across its runs. | Nothing |
list_saved_formulas | Your saved playbooks, with their schedules. | Nothing |
save_formula | Saves a playbook's answers, to run again by hand or on a schedule; needs a unit cap. | Nothing to save; each run, its units |
cancel_formula_run | Stops a playbook run. | Nothing |
Then the scraper tools, and those of Datasets:
| Tool | What it does | Costs |
|---|---|---|
list_scrapers | Searches the catalogue by words, family or industry: the best matches, with their id, title, summary, family and billing unit. | Nothing |
list_families | The industries and the families in each, with how many scrapers each has. | Nothing |
get_scraper | One scraper: the JSON Schema of its input, an example input, the fields of its records, and its success rate and median time over 7 days. | Nothing |
run_scraper | Starts a run and waits for it, up to 50 seconds unless asked for longer. Returns the run, what it cost and the first records. | Units, when the run ends ok or partial |
get_run | One run: its status, reason, record count and units. | Nothing |
get_run_records | A page of a run's records, with a cursor to the next. | Nothing |
cancel_run | Asks a run to stop. | Nothing |
list_runs | Your runs, newest first. | Nothing |
get_usage | The units charged over a period, and your allowance. | Nothing |
get_billing | Where your account stands: units used and left this month, top-up units, runs that can start. | Nothing |
data_search_postings | Datasets: searches job postings. | 1 data unit a posting returned |
data_get_posting | Datasets: one posting, with its history. | 1 data unit |
data_list_companies | Datasets: lists companies. | 1 data unit a company returned |
data_get_company | Datasets: one company, by its domain. | 1 data unit |
And three that read the dataset catalogue:
| Tool | What it does | Costs |
|---|---|---|
data_list_datasets | Datasets: the dated datasets, with how much each covers and how fresh it is. | Nothing |
data_get_dataset | Datasets: one dated dataset and the fields of its rows. | Nothing |
data_query_dataset | Datasets: a dated dataset's rows as they were on a date. | The dataset's data units a row returned (1 for most) |
The data_ tools are shown only to an account that has Datasets. The server tells the agent how
to use the tools together, so you can ask for what you want — "get the open jobs on ramp.com's careers page" — and
let it choose the scraper. MCP server says more about each tool.
run_formula spends units too, and so does every scheduled run of a playbook an agent saved. A playbook run is a preview,
its first 10 rows at what they cost, unless the agent asks for a full one; a full run needs a unit cap and never spends
past it, and the agent is told to ask you before a run, a preview or a full one, expected to cost more than 500 units.
The command-line tool#
An agent with a shell can use enrichednow, the command-line tool. Install it on Linux or macOS:
curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | shIt reads the key from ENRICHEDNOW_API_KEY, so an agent that has the variable needs no enrichednow login. These three
commands are what an agent uses — find a scraper, read its input fields, run it and get the records as JSON:
enrichednow scrapers list
enrichednow scrapers show careers.company
enrichednow run careers.company --input domain=northwind.example -o json --quietThe JSON is the API's, field for field. The exit code says how the run ended: 0 for ok or partial, 3 for
failed, unsupported or cancelled, 4 when there is no key or the API did not accept it. All of them are
under Exit codes.
Packages#
For an agent that writes code. Each package starts a run, waits for it and reads its records in a few lines.
| Language | Install | Source |
|---|---|---|
| Python | pip install enrichednow | enrichednow-python |
| JavaScript and TypeScript | npm install enrichednow | enrichednow-js |
| Go | go get github.com/enrichednow/enrichednow-go@latest | enrichednow-go |
| Java | com.enrichednow:enrichednow-java:0.4.0, added to a Maven or Gradle build | enrichednow-java |
The same call in each of them, and with nothing installed in curl:
# Start a run and wait up to 60 seconds for it to finish
curl -X POST "https://api.enrichednow.com/v1/scrapers/careers.company/runs?wait=60" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"domain":"northwind.example"}}'
# Read its records, with the id the first call answered
curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"from enrichednow import EnrichedNow
client = EnrichedNow() # reads ENRICHEDNOW_API_KEY
# Start a run, wait for it to end, and get its records
result = client.scrape("careers.company", {"domain": "northwind.example"})
print(result.run.id, result.run.status, result.run.record_count)
# Read its records: pages are fetched as you go
for record in result.records:
print(record)Install it with pip install enrichednow, then save as run.py and run python3 run.py
import EnrichedNow from "enrichednow";
const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
const { run, records } = await client.scrape("careers.company", { domain: "northwind.example" });
console.log(run.id, run.status, run.record_count);
// Read its records: pages are fetched as you go
for await (const record of records) console.log(record);Install it with npm install enrichednow, then save as run.mjs and run node run.mjs
package main
import (
"context"
"fmt"
"log"
"time"
enrichednow "github.com/enrichednow/enrichednow-go"
)
func main() {
client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
// Start a run, wait for it to end, and get its records
run, records, err := client.Scrape(ctx, "careers.company", map[string]any{"domain": "northwind.example"})
if err != nil {
log.Fatal(err)
}
fmt.Println(run.ID, run.Status, run.RecordCount)
// Read its records: pages are fetched as you go
for records.Next() {
fmt.Println(string(records.Current()))
}
if err := records.Err(); err != nil {
log.Fatal(err)
}
}Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go
import com.enrichednow.EnrichedNowClient;
import com.enrichednow.ScrapeResult;
import java.util.Map;
public class Run {
public static void main(String[] args) {
EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
ScrapeResult result = client.scrape("careers.company", Map.of("domain", "northwind.example"));
System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
// Read its records: pages are fetched as you go
for (Map<String, Object> record : result.records()) {
System.out.println(record);
}
}
}Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java
enrichednow run careers.company --input domain=northwind.exampleInstall it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh
A prompt to give an agent#
Paste this into an agent's instructions — a system prompt, a rules file, a project's notes — when it will call the API itself. It is not needed with the MCP server, which says the same to the agent when it connects.
You can use the EnrichedNow API to read public web pages as structured records.
Address: https://api.enrichednow.com/v1
Key: send the header "Authorization: Bearer $ENRICHEDNOW_API_KEY" with every request. The key is in the
environment variable ENRICHEDNOW_API_KEY. Never print it and never write it to a file.
How to get records:
1. Find a scraper. GET /v1/scrapers lists them: id, title, summary, billing_unit ("request",
"record" or "page") and what a run costs (units_per_request, units_per_record or units_per_page).
This call needs no key.
2. Read its input. GET /v1/scrapers/{id} returns input_schema, a JSON Schema, and record_schema.
Send only the fields the schema names.
3. Run it. POST /v1/scrapers/{id}/runs?wait=60 with the JSON body {"input": {...}}. wait is a number
of seconds from 0 to 300. The answer is a run: id, status, reason, record_count, units.
- HTTP 200: the run ended within the wait. Its status is final.
- HTTP 202: the run is still queued or running. Ask GET /v1/runs/{id} every 2 seconds until the
status is final.
- Every POST starts a new run. Never repeat it to read a result; use GET /v1/runs/{id}.
4. Read the records. GET /v1/runs/{id}/records?limit=100 returns {"records": [...], "next_cursor": ...}.
Pass next_cursor back as cursor until it is null. Records are kept for 7 days after the run ended.
Statuses. In progress: queued, running. Final: ok, partial, failed, unsupported, cancelled.
- ok: the target was read. record_count 0 is a real answer, not an error.
- partial: records came back with a known gap. reason names the gap.
- failed: the target could not be read. reason says why. There are no records.
- unsupported: the target needs something the scraper does not do. Trying again gives the same answer.
- cancelled: the run was stopped, with POST /v1/runs/{id}/cancel.
A run that could not read its target still answers HTTP 200. Always read status and reason. In a
record, a value that is not known is null.
Cost. A run is charged once, when it ends, and only if it ended ok or partial: the scraper's
units_per_request when its billing_unit is "request", its units_per_record for each record when it
is "record", its units_per_page for each result page it read when it is "page" (never more pages
than the input asks for). A run that ends failed, unsupported or cancelled costs nothing. Reading
scrapers, runs, records and usage costs nothing. GET /v1/usage returns the units used and the
allowance. Before you run a scraper billed per record or per page, tell the user what it costs for
each record it returns or each page it reads.
Errors are JSON: {"error": {"code": "...", "message": "...", "details": {...}}}. Match on code.
- invalid_input (422): details.fields says what is wrong. Fix the request, then send it again.
- unauthorized (401): the key is missing or wrong. Stop and ask the user.
- quota_exceeded (402): the units are used up. Stop and tell the user. Do not retry.
- too_many_runs (429): too many runs are going at once. Wait for one to end, then send it again.
- not_found (404): no such scraper or run. Check the id against GET /v1/scrapers.
- internal (500): try again after a pause. After a failed POST, look at GET /v1/runs first: the run
may exist.
Documentation: https://docs.enrichednow.com/llms.txt lists every page. A scraper's inputs, record fields and an
example are at https://docs.enrichednow.com/scrapers/{id}.md.Every line of it is said in full on a page of this site: Running a scraper, Results and statuses, Usage and units and Errors.