Build Make an API 01 / 11
Turn a website into an API
Describe what you need from a site; Scribe builds the API, tests it, and gives you REST and MCP access.
On this page
Use this when you need data from a website, or an action on it, and the site offers no API you can use. You write one sentence about the result you want. Writ builds the functions, proves each one on the live site, and saves them as an API you can call from code, from your AI assistant or on a schedule.
Build an API in the app
-
Open the Website to API form
In the Writ app, open Create, pick Turn a website into an API and click Open in Scribe. You can also open Scribe from the sidebar (⌘J) and choose the starter Turn a website into an API.
In Writ Desktop, open Create and pick Turn a website into an API, or use the Create an API for a site door on Home. Scribe needs an AI model: add your own key in Settings → AI Provider, or link a Writ Cloud account and use its AI.
-
Describe the API
Fill in Website (for example
https://example.com) and What the API should do, in plain words, up to 1,500 characters. If the data is behind a login, pick a persona in Sign in as. Leave it empty for public pages. -
Click Build the API
Scribe first looks for something that already does the job: one of your own APIs for the same site, or a ready-made API. If one fits, it offers it and you choose. Otherwise it builds. Describe something else instead takes you back to a blank Scribe conversation.
-
Watch Scribe build it
Scribe opens a real browser on the site and uses it the way a person would. It finds how the site serves the data: often a request the page sends in the background, otherwise the page itself. It writes one function per thing you asked for, then calls each function on two different inputs to check that it returns real data. The panel shows each step as it happens.
-
Answer when it asks
Scribe stops and asks when it needs you: a persona for a sign-in, a verification code, a CAPTCHA to solve in the live browser, or a choice between options. While it waits, the Scribe button in the sidebar shows Needs you. See Scribe, the assistant for every kind of question.
-
Open your API
When the build ends, Your result is ready links to the new API. It is listed under APIs, with one entry per function on its Functions tab. If some functions could not be proven, the panel says Partly built and lists them: ask Scribe to continue, or add them later.
Next, try each function and publish the endpoint: Test and edit an API.
Write a request Scribe can build
Name the inputs a caller will change, the fields you want back, and each separate action. Scribe turns each action into its own function and each “let me choose” into an input.
| Clear request | Too vague |
|---|---|
| “Search apartments for rent by city and maximum price. Return title, price, address, number of rooms and link. Let me choose how many results.” | “Get the apartments.” |
| “List my orders with date, total and status. Add a second function that returns the items of one order by its order number.” | “Make an API for my account.” |
| “Post a message to a channel. Inputs: channel name and text. Return the link to the new message.” | “Automate this site.” |
- Give the page where the data lives when you know it, not only the home page.
- Say when a function changes something on the site (posts, submits, buys), so Scribe tests it with care.
- Ask for one site per API. For a second site, start a second build.
Logins and sites that refuse Writ
Sites behind a login
Pick a persona in Sign in as. A persona holds the login for one site, and Writ signs in with it on every run. If you have none, Scribe offers to create one while it builds; you type the login into a form, never into the chat. See Sign-ins and secrets.
When a site refuses Writ’s servers
Some sites turn away connections from data centers. When that happens, the build stops and Scribe says so, then lists what gets past it on your account, in this order: Upgrade to the plan that includes residential connections (recommended), Do it from your computer with Writ Desktop (free on every plan), Buy credits, or Try from Writ’s servers anyway. Details and prices: Blocks, CAPTCHAs and hand-offs.
Add or fix a function later
An API is never final. On the API’s page, under its name, click Missing a function? Tell Scribe →. Scribe asks what the new function should do, builds it, tests it on the live site and adds it to the same API, next to the functions you already have.
To change a function that returns the wrong data, open Scribe and say what is wrong, for example “The price field in search_listings is empty since yesterday.” Scribe reuses your API instead of building a new one. How Writ notices and repairs breaks on its own: Keep an API working.
Build from your assistant or your code
From your AI assistant
Connect Writ Cloud to your assistant over MCP (Connect an AI assistant), then ask, for example: “Turn news.ycombinator.com into an API that returns the top stories.” Your
assistant calls writ_website_to_api, and Writ opens a cloud browser tied to that build. Your
assistant drives it: it uses the site, reads the requests the page makes, defines the functions, tests
each one on two inputs and saves.
Your assistant’s own model does the thinking, so a build from your assistant spends your assistant’s tokens. It does not count against your Writ AI builds, and its browser is not charged in credits. A build that Writ’s AI started and could not finish can also be handed to your assistant: see Continue a build.
From the REST API
A program cannot drive a browser turn by turn, so over REST Writ’s own AI builds the API. You start a build, then check on it until it ends.
https://api.usewrit.app/api/v1/website-to-api Body
-
urlstring required - The site to start on, for example
https://example.com. -
goalstring required - What the API should return or do, in plain words. Up to 5,000 characters.
-
persona_idinteger - The persona to sign in with, for pages behind a login.
-
tierstring defaultstandard standardordeep. A deep build covers the whole site with bigger bounds (60 browser minutes, 1,000,000 AI tokens, 200 MB of residential bandwidth, up to 40 functions) and always costs 6,000 credits, never an included build.-
accept_creditsboolean defaultfalse - Your consent to pay credits for this build: a standard build past your plan’s monthly count (1,500 credits) or a deep build (6,000 credits). Without it the call answers
402withbuild_quota_exhaustedorbuild_credits_consent_required, theprice_creditsand yourcredits_available; send the same request again withaccept_credits: true. The credits are held while the build runs; the full price is charged only when it delivers a working API, and a build you stop pays what it used so far, never more than its price.build_credits_insufficientmeans the price is not covered. -
save_asstring - The name of the API the build saves.
-
skip_existingboolean defaultfalse - Build even when one of your own APIs already matches the goal.
-
skip_marketplaceboolean defaultfalse - Build even when a ready-made API already matches the goal.
-
contribute_to_catalogboolean - Your Marketplace choice for this build. Left out, the rules below decide: a free build is submitted to the Marketplace for review, a build paid in credits stays private.
truesubmits it;falsekeeps it private, on Starter and up or during a trial. See Free builds go to the Marketplace.
curl -X POST https://api.usewrit.app/api/v1/website-to-api \
-H "Authorization: Bearer $WRIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://news.ycombinator.com",
"goal": "Top stories with title, points, comment count and link. Let me ask for how many.",
"save_as": "Hacker News"
}' import os, requests
API = "https://api.usewrit.app"
HEADERS = {"Authorization": f"Bearer {os.environ['WRIT_API_KEY']}"}
res = requests.post(
f"{API}/api/v1/website-to-api",
headers=HEADERS,
json={
"url": "https://news.ycombinator.com",
"goal": "Top stories with title, points, comment count and link. Let me ask for how many.",
"save_as": "Hacker News",
},
)
res.raise_for_status()
build = res.json()
print(build["status"]) # queued, existing_workflows or marketplace_candidates const API = "https://api.usewrit.app";
const headers = {
Authorization: `Bearer ${process.env.WRIT_API_KEY}`,
"Content-Type": "application/json",
};
const res = await fetch(`${API}/api/v1/website-to-api`, {
method: "POST",
headers,
body: JSON.stringify({
url: "https://news.ycombinator.com",
goal: "Top stories with title, points, comment count and link. Let me ask for how many.",
save_as: "Hacker News",
}),
});
const build = await res.json();
console.log(build.status); // queued, existing_workflows or marketplace_candidates
The answer comes back at once with status 202, in one of three forms. The first two cost
nothing and use no AI:
existing_workflows: one of your APIs already covers the goal. Run it, or send the request again withskip_existingset totrue.marketplace_candidates: a ready-made API covers it. Install it, or send again withskip_marketplaceset totrue.queued: the build has started. Keep itsbuild_id.
{
"build_id": 9031,
"status": "queued",
"url": "https://news.ycombinator.com",
"goal": "Top stories with title, points, comment count and link. Let me ask for how many.",
"created_at": "2026-10-31T14:02:11Z",
"completed_at": null,
"workflow_id": null,
"error": null
} {
"status": "existing_workflows",
"message": "Your library already has workflows matching this goal — replaying one is instant and costs no AI.",
"goal": "Top stories with title, points, comment count and link. Let me ask for how many.",
"workflows": [
{
"workflow_id": 4822,
"name": "Hacker News",
"description": "Top stories from news.ycombinator.com",
"inputs": ["limit"],
"functions": ["top_stories"],
"run": { "tool": "writ_run_workflow", "arguments": { "workflow_id": 4822 } }
}
],
"next": "Run one with POST /api/v1/workflows/{workflow_id}/runs (writ_run_workflow), or call again with skip_existing=true to build fresh."
} {
"status": "marketplace_candidates",
"message": "Ready-made marketplace APIs already cover this goal.",
"goal": "Top stories with title, points, comment count and link. Let me ask for how many.",
"candidates": [
{
"slug": "hacker-news-top-stories",
"title": "Hacker News top stories",
"summary": "Front page stories with points and comment counts."
}
],
"next": "Install one, or call again with skip_marketplace=true to build fresh."
} https://api.usewrit.app/api/v1/website-to-api/{build_id}
Check every few seconds. The build ends on succeeded, failed or cancelled; on success, workflow_id is your new API.
curl https://api.usewrit.app/api/v1/website-to-api/9031 \
-H "Authorization: Bearer $WRIT_API_KEY" import time
# Continues the example above: API, HEADERS and build are already set.
while build["status"] in ("queued", "building") or build.get("superseded"):
time.sleep(10)
# When Writ moves the build to another approach, it gives the new id.
build_id = build.get("fallback_build_id") or build["build_id"]
build = requests.get(f"{API}/api/v1/website-to-api/{build_id}", headers=HEADERS).json()
if build["status"] == "succeeded":
print("API ready, workflow", build["workflow_id"])
else:
print(build["status"], build.get("error") or build.get("next")) // Continues the example above: API, headers and build are already set.
let current = build;
while (["queued", "building"].includes(current.status) || current.superseded) {
await new Promise((r) => setTimeout(r, 10_000));
// When Writ moves the build to another approach, it gives the new id.
const id = current.fallback_build_id ?? current.build_id;
const res = await fetch(`${API}/api/v1/website-to-api/${id}`, { headers });
current = await res.json();
}
if (current.status === "succeeded") {
console.log("API ready, workflow", current.workflow_id);
} else {
console.log(current.status, current.error ?? current.next);
} {
"build_id": 9031,
"status": "building",
"url": "https://news.ycombinator.com",
"goal": "Top stories with title, points, comment count and link. Let me ask for how many.",
"created_at": "2026-10-31T14:02:11Z",
"completed_at": null,
"workflow_id": null,
"error": null,
"progress": "Reading the front page",
"steps_taken": 6,
"current_url": "https://news.ycombinator.com/"
} {
"build_id": 9031,
"status": "succeeded",
"url": "https://news.ycombinator.com",
"goal": "Top stories with title, points, comment count and link. Let me ask for how many.",
"created_at": "2026-10-31T14:02:11Z",
"completed_at": "2026-10-31T14:06:40Z",
"workflow_id": 4822,
"error": null
} Fields worth reading
-
statusstring queued,building,succeeded,failed,cancelledorneeds_guidance.-
tierstring standardordeep.-
price_creditsinteger - What the build costs in credits;
0when an included build covers it. -
paidboolean - Credits are held for this build.
-
chargedboolean - The held credits were settled: the full price once the build delivered a working API, or what a build you stopped had used, never more than its price. A failed or parked build releases them.
-
progressstring - What the build is doing now, while it runs.
-
fallback_build_idinteger - Writ moved the build to another approach under this id, and
supersededistrue. Follow the new id. -
missing_functionsarray - Functions you asked for that could not be proven, with the reason.
-
needs_sign_inboolean - The build stopped at a sign-in page. Start it again with a
persona_id. -
site_blockobject - The site refused Writ’s servers. It lists what gets past it on your account.
-
nextstring - On
needs_guidance: why the build paused and how to continue it.
A build that reaches the limit one build may use (30 browser minutes,
300,000 AI tokens or 50 MB of
residential bandwidth for a standard build; 60 minutes,
1,000,000 tokens, 200 MB and up to
40 functions for a deep build) pauses as needs_guidance and keeps what it
found. Your AI assistant can finish it; a paid build that parks charges nothing. Once it succeeds, call the API like any other: Call your API.
What it costs
Each plan includes a number of standard builds by Writ’s AI per month. Past that number a standard build is 1,500 credits, and a deep build (the whole site, with bigger bounds) is 6,000 credits on every plan, never an included build. The credits are held when the build starts, and the full price is charged only when it delivers a working API: a build that fails or parks charges nothing and releases the hold. A build you stop pays what it used so far (Writ’s AI, browser time and residential traffic, at the usual rates), never more than its price; the app tells you what that is before you stop it. A build on your plan’s included number stays counted when you stop it. A build that fails because of Writ, such as a lost browser, does not count against the included number either.
| Plan | Writ AI builds per month |
|---|---|
| Free | 5 |
| Starter | 20 |
| Pro | 50 |
| Growth | 200 |
| Scale | 500 |
| Enterprise | Unlimited |
- Scribe’s own replies around the build use Writ’s AI and are billed by tokens. See Scribe, the assistant.
- A build from your own AI assistant, or on Writ Desktop with your own AI key, is free and unlimited.
- Once built, each call on Writ Cloud costs 2 credits without a browser and 20 credits with one. A call that fails because of the site or Writ costs nothing.
- Calls that run on Writ Desktop are free.
All prices and plans: Credits and plans.
Free builds go to the Marketplace
A free build on Writ Cloud, one of your plan’s included Writ AI builds or a build made with your own AI assistant over MCP, is submitted to the Marketplace once its functions pass a proof run, and Writ reviews it before it is listed. That is the deal of a free build. A build you stop is submitted too when some of its functions already passed their live test, with those functions only.
- A build paid in credits stays private unless you list it.
- A build that signs in with your account (a login, a persona or a secret) is never listed without your yes.
- A site that is not on the public internet is never listed.
- On Starter and up, and during a free trial, you can keep your builds private: all of them with Keep my free builds private in Settings → Overview, or one build at a time (
contribute_to_catalog: falseover the API). On Free, a free build is always submitted; a choice made during a trial stops applying when the trial ends.
Next
- 01 Test and edit an API Try each function, publish the REST endpoint, expose it over MCP.
- 02 Call your API Endpoints, keys, waiting for results, caching and errors.
- 03 Sign-ins and secrets Personas, 2FA codes and the secrets vault.
- 04 Record a workflow For multi-step actions, show Writ the clicks yourself.