Skip to main content

Set up Netscrape with an AI agent

Coding agents such as Claude Code, Cursor, Codex and ChatGPT can set Netscrape up for you. Paste one of the prompts below into your agent. Each one points it at /llms.txt, an index of these docs written for agents, so it reads the same reference you would.

Before you start: an API key

The agent needs a Netscrape API key, and keys come only from a paid Netscrape account. There's no trial or anonymous access.

  1. Sign in, or create an account with the sign-up link at the top of this page (if self-serve signup is closed, request access). Verifying your email signs you in.
  2. Choose a plan on your account's Billing page.
  3. Open the API keys page and press Create API key. Copy the key straight away: it's shown only once.

Give the key to your agent as an environment variable rather than pasting it into the chat:

export NETSCRAPE_API_KEY="your key"

Until your account has an active plan, requests that would read pages answer 402 subscription_required. The prompts below tell the agent to stop and tell you if that happens.

What agents can read

URL What it is
/llms.txt What Netscrape does, how to get access, and a link to every page below as Markdown.
/llms-full.txt Every docs page in one Markdown file.
/docs/<page>.md Any docs page as Markdown, such as /docs/quickstart.md.
/openapi.json The OpenAPI 3.1 spec for every public endpoint, with its error codes.

If your agent speaks MCP, it can also use Netscrape as tools; see the MCP server.

Claude and ChatGPT

The Claude and ChatGPT apps connect by signing in, with no API key: add https://netscrapehq.com/mcp as a custom connector, choose automatic (dynamic) client registration, sign in with your Netscrape account and click Allow connection. The MCP guide has each app's steps. You need an active plan to connect, and you can see and revoke connected apps on your Connected apps page.

Keep my product prices fresh

For a catalogue or comparison site that shows prices read from other websites.

Add Netscrape to this project to keep our product prices fresh.

First read https://netscrapehq.com/llms.txt and follow its links: the watches
guide, the events guide and https://netscrapehq.com/openapi.json. Use only
endpoints and fields documented there.

The Netscrape API key is in the NETSCRAPE_API_KEY environment variable. It
comes from a paid Netscrape account, created at
https://netscrapehq.com/account/keys. If it isn't set, or the API answers 401
or 402 subscription_required, stop and tell me; don't work around it. Never
print, log or commit the key.

1. Find where this project stores product pages and their prices.
2. For each product URL, create a watch with POST /v1/watches. Use the
   product's id as external_id so re-running enrolment updates the same watch.
   Read the price with request.output "document" and an extract rule (a CSS
   selector, text pattern or JSON-LD Product), and set compare.on to
   "extract" so only the price fields are compared. Pick freshness.max_age
   from how stale a price may get, no shorter than 1h.
   Enrol many products at once with POST /v1/watches/batch.
3. Receive watch.changed events, by webhook if this app can take HTTPS POSTs
   (verify the x-netscrape-signature header as documented) or else by polling
   GET /v1/events with a stored cursor. On each change, update the stored
   price from the event's changed fields.
4. Handle 429 by waiting Retry-After seconds, and treat 402 as a billing
   problem to report, not a bug to retry.
5. Add tests that use recorded responses; don't call the live API in tests.

Show me the plan before you write code.

Watch this page and tell me when it changes

For one page, or a handful, that you want to hear about.

Use Netscrape to watch this page and tell me when it changes: <URL>

First read https://netscrapehq.com/llms.txt and the quickstart it links to.

The API key is in the NETSCRAPE_API_KEY environment variable. It comes from a
paid Netscrape account, created at https://netscrapehq.com/account/keys. If
it isn't set, or a request answers 401 or 402 subscription_required, stop and
tell me. Never print the key.

1. Create a watch with POST /v1/watches for the URL, compare.on "text", and a
   freshness.max_age of 1d unless I said otherwise.
2. Ask for a delivered check now with POST /v1/watches/:id/check and
   {"deliver": true}, wait for its watch.checked event in GET /v1/events, and
   show me what Netscrape read.
3. Tell me how I'll hear about changes: the webhook settings in my Netscrape
   account, or a script that polls GET /v1/events with a stored cursor and
   prints each watch.changed diff.

Fetch this page as Markdown

For a one-off read, such as giving the agent a page's content to work with.

Use Netscrape to fetch this page and give me its content as Markdown: <URL>

First read https://netscrapehq.com/llms.txt and the jobs guide it links to.

The API key is in the NETSCRAPE_API_KEY environment variable. It comes from a
paid Netscrape account, created at https://netscrapehq.com/account/keys. If
it isn't set, or a request answers 401 or 402 subscription_required, stop and
tell me. Never print the key.

1. Submit a job with POST /v1/jobs and the body {"url": "<URL>",
   "render": "auto", "output": "document"}.
2. Poll GET /v1/jobs/:id every few seconds until status is succeeded, failed
   or cancelled, then download GET /v1/jobs/:id/result.
3. Netscrape returns the page's readable text, not Markdown: document.title,
   and document.body_text with headings, lists and tables on their own lines.
   Turn that into Markdown with the title as a heading. Don't invent content
   that isn't in the result.
4. If the result's status isn't 200, or challenge isn't null, tell me what
   Netscrape saw instead of guessing at the page.

Receive changes in my app

For an app that already has watches and needs to act on their events.

Add a Netscrape webhook receiver to this app.

First read https://netscrapehq.com/llms.txt and the events guide it links to,
especially webhooks, verifying signatures, retries and the event feed.

The API key, from a paid Netscrape account
(https://netscrapehq.com/account/keys), is in NETSCRAPE_API_KEY, and the
webhook signing secret is in NETSCRAPE_WEBHOOK_SECRET. If either is missing,
stop and tell me where to create it. Never print or commit them.

1. Add an HTTPS endpoint that verifies x-netscrape-signature against the raw
   body, rejects timestamps more than five minutes old, and answers 2xx
   within 10 seconds, doing slow work afterwards.
2. Deduplicate on the event id and process events in sequence order.
3. Add a recovery job that reads GET /v1/events from the last stored
   sequence, so nothing is lost while the endpoint was down.
4. Test it with signed fixtures, then tell me to set the webhook URL and send a
   test delivery from my Netscrape account's webhook settings.

Tips for agents