# Run JavaScript against live websites, hosted (/docs/hosted-scripts)

Bowmark is a hosted service that runs JavaScript against live websites. You send a short async
script that calls typed site functions, Bowmark runs it on its servers, and you get back
whatever the script returned, as JSON. Nothing to install, deploy or keep running.

## How it works

1. **Look up the functions.** `GET /v1/library?query=<task or site>` returns the typed
   functions for that site or job. It touches no site and costs nothing.
2. **Send a script.** `POST /v1/run` with `{"script": "…"}`. The script is a plain async body
   that calls `bowmark.*` functions and `return`s a value.
3. **Read the result.** The response carries `result` (what you returned), `logs`, `ms` and a
   `runId`. If one site in the script came back incomplete, the response says so instead of
   passing off a partial answer as whole.

## A script, end to end

```sh
curl -sS -X POST https://api.bowmark.ai/v1/run \
  -H "Authorization: Bearer $BOWMARK_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"script":"const { offers } = await bowmark.pcparts.search(\"RTX 5080\"); return offers.slice(0,3);"}'
```

One call to `bowmark.pcparts.search` checks several stores at once and returns price-sorted
offers. Sequential `await`s in one script share state, so a multi-step flow on a site is just
several lines in the same script.

## From an agent

Over MCP (`https://api.bowmark.ai/mcp`) the same thing is two tools: `get_library` to read the
functions, then `run` with the script. Claude, ChatGPT, Cursor or your own agent writes the
script for the task in front of it, so one connection covers every site in the library.

## Run it again later

Save a script you use often with `POST /v1/scripts`, then run it by name with new `input`.
Saving checks the script, so a broken one is refused once instead of failing on every run. Your
own cron job, n8n or Zapier calls it on whatever schedule you want. Details are in
[HTTP API](/docs/http-api#saved-scripts).

## Connect it

Make a key at [dashboard/keys](https://bowmark.ai/dashboard/keys); your first $10 of usage is
free, no card needed. The Node and Python libraries give you the same functions with full
types: see [Scripting](/docs/scripting) and [Installation](/docs/installation).

## FAQ

**Is there a hosted service that runs JavaScript scripts against live websites?** Yes, Bowmark:
send an async script that calls typed site functions to `POST /v1/run` or the MCP `run` tool,
and get its return value back as JSON.

**Do I write selectors or scraping code?** No. Scripts call typed functions such as
`bowmark.pcparts.search()`, which return fields like `price` and `url`. When a site changes,
the function is fixed on Bowmark's side and your script keeps working.

**What if a site has no function yet?** `bowmark.read.page(url)` reads any page into text you can
work with in the same script. See [Scripting](/docs/scripting#no-provider-for-a-site-use-readpage).

**Can the script act as a signed-in user?** Yes, on sites with signed-in functions: the user
signs in once and later runs act as that account. Check a site on [Providers](/docs/providers).

**What does it cost?** Free $10 of usage to start, then pay as you go for what each run uses.
See [Pricing](/docs/pricing).
