{"openapi":"3.1.0","info":{"title":"Bowmark API","version":"1.0.0","description":"Run real tasks on live websites over plain HTTP. Two calls: read the typed function library for your task with `GET /v1/library`, then send a short async JavaScript script written against it to `POST /v1/run`. Or call one site's functions directly: every site in `GET /v1/sites` has its own spec at `/v1/sites/{site}/openapi.json`. Guide: https://bowmark.ai/docs/api. Get a key at https://bowmark.ai/dashboard/keys.","contact":{"email":"support@bowmark.ai","url":"https://bowmark.ai/docs/api"},"termsOfService":"https://bowmark.ai/terms"},"externalDocs":{"description":"HTTP API guide","url":"https://bowmark.ai/docs/api"},"servers":[{"url":"https://api.bowmark.ai"}],"security":[{"bearer":[]},{"apiKeyHeader":[]}],"paths":{"/v1/library":{"get":{"operationId":"getLibrary","summary":"Read the function library for a task or a site","description":"Read-only, touches no site, costs nothing. Returns the `bowmark.*` functions, their arguments and return types for the task. A query that matches nothing returns the index rather than an error. Markdown by default; send `Accept: application/json` for JSON.","parameters":[{"name":"query","in":"query","required":false,"description":"The task or the site's hostname (`flights`, `amazon.com`). Repeat it for a task with several parts (`?query=flights&query=hotels`), up to 6.","schema":{"type":"array","items":{"type":"string"},"maxItems":6},"style":"form","explode":true}],"responses":{"200":{"description":"The library.","content":{"text/markdown":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"object","required":["library","queries"],"properties":{"library":{"type":"string","description":"The library, as markdown."},"query":{"type":["string","null"]},"queries":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"More than 6 queries in one request."},"401":{"description":"No API key, or a key that was refused."}}}},"/v1/run":{"post":{"operationId":"run","summary":"Run a script against the library on live sites","description":"The script is the body of an async function: use `await` freely and `return` the result. It runs in a sandbox with the `bowmark` global and `log()`. Read `GET /v1/library` first for the exact function names.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"script":{"type":"string","description":"Starts a run. Send exactly one of `script` or `runId`."},"runId":{"type":"string","format":"uuid","description":"Collects a run that answered `status: \"running\"` (a run started with `maxSeconds`). Send it alone, with no `script`. Each call waits under 90 seconds; repeat while it says running."},"maxSeconds":{"type":"integer","minimum":100,"maximum":900,"description":"Optional. Lets this one run last this many seconds instead of the default 90, for long paging jobs. The call answers within about 80 seconds with `status: \"running\"` and a `runId`; collect it by POSTing `{ \"runId\": ... }`. Outside 100-900, or combined with `waitMs`, is a 400."},"egress":{"type":"string","enum":["default","link"],"description":"Optional. `link` sends every request of the run through your own Chrome (Bowmark Buddy) and fails with \"Link not connected\" when it is not open, never falling back to Bowmark's route. Any other value is a 400."},"waitMs":{"type":"number","minimum":1000,"description":"Optional. How long you will wait for this run, in ms. The run's deadline shrinks to it, so a slow site or store is cut and named in `incomplete` instead of holding the whole answer. It can only shorten a run (the ceiling is 90 s); under 1000 or not a number is a 400."}}},"example":{"script":"const { offers } = await bowmark.pcparts.search(\"RTX 5080\"); return offers.slice(0, 3);"}}}},"responses":{"200":{"description":"The run was accepted. That includes a script that threw (`status: error`) or paused for a sign-in (`status: needs_user`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/recipes":{"get":{"operationId":"listRecipes","summary":"List ready-made scripts","security":[],"responses":{"200":{"description":"Every recipe and the inputs it takes.","content":{"application/json":{"schema":{"type":"object","properties":{"recipes":{"type":"array","items":{"$ref":"#/components/schemas/Recipe"}}}}}}}}}},"/v1/recipes/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"getRecipe","summary":"Read one recipe, including its script","security":[],"responses":{"200":{"description":"The recipe.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Recipe"},{"type":"object","properties":{"script":{"type":"string"}}}]}}}},"404":{"description":"No recipe by that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}},"post":{"operationId":"runRecipe","summary":"Run a recipe with your inputs","description":"The body is the recipe's inputs as a JSON object. Same envelope, billing and status codes as `POST /v1/run`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"The run was accepted. That includes a script that threw (`status: error`) or paused for a sign-in (`status: needs_user`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"description":"No recipe by that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/scripts":{"get":{"operationId":"listScripts","summary":"List your saved scripts","responses":{"200":{"description":"Every script you saved, by name.","content":{"application/json":{"schema":{"type":"object","properties":{"scripts":{"type":"array","items":{"$ref":"#/components/schemas/SavedScript"}}}}}}},"401":{"description":"No API key, or a key that was refused."}}},"post":{"operationId":"saveScript","summary":"Save a script under a name","description":"Saves a script you can later run by its id or name with `POST /v1/scripts/{ref}/run`. Saving over a name you already used replaces its script and keeps its id. The script is checked when you save it, so one that does not parse is refused here. Inside it, `input` is the object the run passes. Scripts belong to you, not to one key: every key on your account sees the same ones.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","script"],"properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"},"script":{"type":"string","maxLength":100000},"description":{"type":"string","maxLength":500}}},"example":{"name":"rintaro-slots","script":"return await bowmark.providers.resy.checkAvailability({ venueId: input.venueId, date: input.date, partySize: 2 });"}}}},"responses":{"201":{"description":"The saved script.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedScript"}}}},"400":{"description":"The body is not a script we can save (the reason is in `error`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused."},"409":{"description":"You already have 200 saved scripts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/scripts/{ref}":{"parameters":[{"name":"ref","in":"path","required":true,"description":"The script's id or its name.","schema":{"type":"string"}}],"get":{"operationId":"getScript","summary":"Read one of your saved scripts","responses":{"200":{"description":"The saved script.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedScript"}}}},"404":{"description":"You have no saved script by that id or name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}},"delete":{"operationId":"deleteScript","summary":"Delete one of your saved scripts","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}}}}},"404":{"description":"You have no saved script by that id or name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/scripts/{ref}/run":{"parameters":[{"name":"ref","in":"path","required":true,"description":"The script's id or its name.","schema":{"type":"string"}}],"post":{"operationId":"runScript","summary":"Run one of your saved scripts with an input","description":"`input` is the object the script reads as `input`. Same envelope, billing and status codes as `POST /v1/run`.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"input":{"type":"object","additionalProperties":true}}},"example":{"input":{"venueId":339,"date":"2026-10-31"}}}}},"responses":{"200":{"description":"The run was accepted. That includes a script that threw (`status: error`) or paused for a sign-in (`status: needs_user`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"description":"You have no saved script by that id or name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/files":{"get":{"operationId":"listFiles","summary":"List your account's files","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"`{ files: [...] }`, newest first.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"No API key, or a key that was refused."}}},"post":{"operationId":"createFileUpload","summary":"Start uploading a file of your own","description":"Step 1 of 3. Returns `{ id, uploadUrl, headers, expiresAt }`: PUT the raw bytes to `uploadUrl` with `headers`, then call `POST /v1/files/{id}/complete`. A file past about 5 GB answers `multipart: { partSize, partCount }` instead of an `uploadUrl`. A run reads the file with `bowmark.files.get(id, { content: true })`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","contentType","bytes"],"properties":{"name":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":1}}}}}},"responses":{"201":{"description":"The upload link.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"No API key, or a key that was refused."}}}},"/v1/files/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"getFile","summary":"Read one file's details, with a 1-hour download url","responses":{"200":{"description":"The file.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"No API key, or a key that was refused."},"404":{"description":"No such file on this account."}}},"delete":{"operationId":"deleteFile","summary":"Delete a file","responses":{"200":{"description":"`{ deleted: true }`.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"No API key, or a key that was refused."},"404":{"description":"No such file on this account."}}}},"/v1/files/{id}/complete":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"operationId":"completeFileUpload","summary":"Finish an upload once the bytes are PUT","responses":{"200":{"description":"The file, private.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"No API key, or a key that was refused."},"404":{"description":"No such file on this account."}}}},"/v1/usage":{"get":{"operationId":"getUsage","summary":"Your charges for a month, line by line","description":"What your account has been charged for the current UTC month, itemized by SKU. Read it before and after a few runs to measure what a call costs. Each `sku` matches a code on bowmark.ai/docs/pricing. Needs an API key.","parameters":[{"name":"month","in":"query","required":false,"description":"A past month as `YYYY-MM`. Default: the current UTC month.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}}],"responses":{"200":{"description":"The month's charges.","content":{"application/json":{"schema":{"type":"object","required":["month","totalUsd","lines","unitemizedUsd"],"properties":{"month":{"type":"string","description":"`YYYY-MM`."},"totalUsd":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","description":"e.g. `ms`, `call`."},"usd":{"type":"number"}}}},"unitemizedUsd":{"type":"number","description":"Charges in the total that carry no line of their own."}}}}}},"400":{"description":"`month` is not `YYYY-MM`."},"401":{"description":"No key, or a bad key."}}}},"/v1/manifest":{"get":{"operationId":"getManifest","summary":"A machine-readable manifest of chosen library units","description":"For code generators. Find unit ids with `GET /v1/library` first; there is no whole-catalog form.","parameters":[{"name":"units","in":"query","required":true,"description":"Comma-separated unit ids, e.g. `flights,providers.kayak`.","schema":{"type":"string"}}],"responses":{"200":{"description":"The manifest.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"`units` is missing or names too many units."},"401":{"description":"No key, or a bad key."}}}},"/v1/sites":{"get":{"operationId":"listSites","summary":"List the sites you can call directly","description":"Every site with its own functions. Each row carries `openapiUrl`, that site's own spec.","security":[],"responses":{"200":{"description":"The sites.","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"sites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"site":{"type":"string"},"mcpUrl":{"type":"string","format":"uri"},"openapiUrl":{"type":"string","format":"uri"}}}}}}}}}}}},"/v1/sites/{site}/openapi.json":{"parameters":[{"name":"site","in":"path","required":true,"description":"A site id from `GET /v1/sites` (`kayak`) or the site's host (`kayak.com`).","schema":{"type":"string"}}],"get":{"operationId":"getSiteSpec","summary":"One site's OpenAPI spec","description":"An OpenAPI 3.1 document with one operation per function of that site, each a `POST /v1/sites/{site}/{fn}`. Feed it to an SDK generator for a typed client.","security":[],"responses":{"200":{"description":"The spec.","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"No site by that id or host.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/{site}/{fn}":{"parameters":[{"name":"site","in":"path","required":true,"schema":{"type":"string"}},{"name":"fn","in":"path","required":true,"schema":{"type":"string"}}],"post":{"operationId":"callSiteFunction","summary":"Call one function of one site","description":"The body is the function's arguments as an object keyed by parameter name. The site's own spec has the exact shape for each function. Same envelope, billing and status codes as `POST /v1/run`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"The run was accepted. That includes a script that threw (`status: error`) or paused for a sign-in (`status: needs_user`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"description":"No such site or function.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Your Bowmark API key (`bmk_…`), from https://bowmark.ai/dashboard/keys."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Bowmark-Key","description":"The same key, for a client that cannot set `Authorization`."}},"schemas":{"RunEnvelope":{"type":"object","description":"What a run returns. `status` says whether the SCRIPT succeeded. A script that threw or paused for a login is still HTTP 200. Branch on `status`, not on the HTTP code.","required":["ok","status","result","logs","error","ms"],"properties":{"runId":{"type":"string","description":"Stable id for this run. Quote it in a support or `report` message."},"ok":{"type":"boolean","description":"False only when the run produced nothing usable."},"status":{"type":"string","enum":["ok","error","partial","needs_user"],"description":"`partial`: the result is real but some calls failed (see `incomplete`); `ok` stays true. `needs_user`: a person must sign in to a site first. Relay `meta.handoff.url` to them, then run again."},"egress":{"type":"string","enum":["default","link"],"description":"The egress the run was given, present only when the request asked for one. `link`: every request went through the caller's own Chrome (Bowmark Buddy)."},"result":{"description":"Whatever the script `return`ed. Any JSON value."},"logs":{"type":"array","items":{"type":"string"},"description":"Lines the script wrote with `log(...)`."},"error":{"type":["string","null"],"description":"Why the run failed, in plain words. Null on success."},"ms":{"type":"integer","description":"How long the script itself ran, in milliseconds."},"queuedMs":{"type":"integer","description":"How long the run waited for a worker before starting. Present only when it was a second or more."},"needs":{"type":"array","description":"The sign-ins this script is waiting on. Present when `status` is `needs_user`.","items":{"type":"object","required":["capability","provider","providerTitle","kind"],"properties":{"capability":{"type":"string"},"provider":{"type":"string"},"providerTitle":{"type":"string","description":"The site's name, to show a person."},"kind":{"type":"string"}}}},"incomplete":{"type":"object","description":"Present only when `status` is `partial`: which calls did not answer.","properties":{"summary":{"type":"string"},"totalCalls":{"type":"integer"}},"additionalProperties":true},"emptyHanded":{"type":"object","description":"Present when the script returned nothing while its calls returned rows, usually a filter that matched none of the site's own labels. Lists the label values the calls actually returned.","additionalProperties":true},"notes":{"type":"array","description":"Caveats a call attached to a complete answer. Never changes `status`.","items":{"type":"object","properties":{"path":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}}}}},"meta":{"type":"object","properties":{"handoff":{"type":"object","description":"A single-use sign-in link for a person to open. Expires at `expiresAt`.","properties":{"ref":{"type":"string"},"url":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"}}},"concurrency":{"type":"object","description":"On a 429: how many runs are in flight and when to retry.","properties":{"limit":{"type":"integer"},"inFlight":{"type":"integer"},"retryAfterSeconds":{"type":"integer"}}}},"additionalProperties":true},"notice":{"type":"object","description":"Set when the account owner has not accepted the current Terms. Relay it to them.","additionalProperties":true}}},"SavedScript":{"type":"object","required":["id","name","script","createdAt","updatedAt","run"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"script":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"run":{"type":"string","description":"The call that runs it."}}},"Recipe":{"type":"object","required":["id","title","description","inputs","example","run"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"inputs":{"type":"array","items":{"type":"object","required":["name","type","required","description"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","string[]","boolean","number","object[]"]},"required":{"type":"boolean"},"description":{"type":"string"},"supported":{"type":"array","items":{"type":"string"},"description":"Every value this input is known to work with. An open set: the description says what else it accepts."}}}},"example":{"type":"object","additionalProperties":true},"run":{"type":"string","description":"The call that runs it."},"docs":{"type":"string","format":"uri","description":"The recipe's own page."},"source":{"type":"string","format":"uri"}}}}}}