brand.dev; the mapping is the same.
Using a coding agent? Give it this prompt:
Migrate this codebase from Context.dev (or Brand.dev) to Olostep. Follow
https://docs.olostep.com/migrate/context-dev.md exactly: swap the SDK and API key,
map every Context.dev web call to its Olostep equivalent, and update the code that
reads the responses. Read OLOSTEP_API_KEY from the environment. List anything with
no Olostep equivalent instead of guessing.
Quick swap
| Context.dev | Olostep | |
|---|---|---|
| Python package | pip install context.dev (formerly brand.dev) | pip install olostep |
| Node package | npm install context.dev (formerly brand.dev) | npm install olostep |
| API key variable | CONTEXT_DEV_API_KEY | OLOSTEP_API_KEY |
| Base URL | https://api.context.dev/v1 | https://api.olostep.com/v1 |
| Auth header | Authorization: Bearer ctxt_secret_... | Authorization: Bearer $OLOSTEP_API_KEY |
| Field style | mostly camelCase | snake_case in HTTP and Python, camelCase options in Node |
# Before
from context.dev import ContextDev
client = ContextDev() # reads CONTEXT_DEV_API_KEY
# After
from olostep import Olostep
client = Olostep() # reads OLOSTEP_API_KEY
// Before
import ContextDev from "context.dev";
const client = new ContextDev({ apiKey: process.env.CONTEXT_DEV_API_KEY });
// After
import Olostep from "olostep";
const client = new Olostep({ apiKey: process.env.OLOSTEP_API_KEY });
Endpoint map
| Context.dev | Olostep | Notes |
|---|---|---|
POST /web/scrape | POST /scrapes | formats is an array instead of an object of booleans |
GET /web/urls (map) | POST /maps | Returns plain URL strings |
POST /web/crawl | POST /crawls | Async on Olostep: poll, then read pages. No 500-page cap |
POST /web/search | POST /searches | Up to 25 results per call (Context.dev: 100) |
POST /web/answers | POST /answers | Same task + json_format shape |
POST /batch/submit with mode: "scrape" | POST /batches | Up to 100,000 URLs per batch on both |
POST /batch/submit with mode: "crawl" | POST /crawls | |
GET /batch/{id}, GET /batch/{id}/results | GET /batches/{id}, GET /batches/{id}/items + GET /retrieve | Content is fetched by retrieve_id |
POST /company/search, POST /people/search | POST /searches with category: { "type": "companies" } or "people" | |
/monitors | /monitors | Different request shape: Olostep takes a natural-language query |
SDK method map
| Context.dev Python | Context.dev Node | Olostep Python | Olostep Node |
|---|---|---|---|
client.web.scrape(url=url, formats={"markdown": True}) | client.web.scrape({ url, formats: { markdown: true } }) | client.scrapes.create(url_to_scrape=url, formats=["markdown"]) | client.scrapes.create({ url, formats: ["markdown"] }) |
client.web.map_urls(domain=domain) | client.web.mapUrls({ domain }) | client.maps.create(url=domain) | client.maps.create({ url: domain }) |
client.web.web_crawl_md(url=url, max_pages=50) | client.web.webCrawlMd({ url, maxPages: 50 }) | client.crawls.create(start_url=url, max_pages=50), then crawl.pages() | client.crawls.create({ url, maxPages: 50 }), crawl.waitTillDone(), then crawl.pages() |
client.web.search(query=q, num_results=10) | client.web.search({ query: q, numResults: 10 }) | client.searches.create(query=q, limit=10) | client.searches.create({ query: q, limit: 10 }) |
client.web.answers(task=t, json_format={...}) | client.web.answers({ task: t, json_format: {...} }) | client.answers.create(task=t, json_format={...}) | client.answers.create({ task: t, jsonFormat: {...} }) |
client.batch.submit(input={"mode": "scrape", ...}) | client.batch.submit({ input: {...} }) | client.batches.create(urls=[...]), then batch.items() | client.batches.create([...]), batch.waitTillDone(), then batch.items() |
| Context.dev | Olostep Python | Olostep Node |
|---|---|---|
res.markdown.data | page.markdown_content | page.markdown_content |
res.html.data | page.html_content | page.html_content |
res.json.data | json.loads(page.json_content) | JSON.parse(page.json_content) |
res.urls[i].url (map) | for url in site_map.urls() | for await (const url of siteMap.urls()) |
res.results[i].markdown (crawl) | page.retrieve(["markdown"]).markdown_content for each page in crawl.pages() | (await client.retrieve.get(page.retrieve_id, ["markdown"])).markdown_content |
res.results[i].url / title (search) | results.links[i]["url"] / ["title"] | results.links[i].url / .title |
res.json_content (answers) | json.loads(answer.json_content) | JSON.parse(answer.json_content) |
res.sources (answers) | answer.sources | answer.sources |
Context.dev returns HTTP 200 even when one output fails, so code checks
markdown.success before reading markdown.data. Olostep returns an error status when a scrape fails, so that per-output check can go.Example
import json
from olostep import Olostep
client = Olostep() # reads OLOSTEP_API_KEY
page = client.scrapes.create(url_to_scrape="https://example.com", formats=["markdown"])
print(page.markdown_content)
site_map = client.maps.create(url="https://docs.olostep.com", top_n=100)
print(list(site_map.urls())[:10])
# crawl.pages() waits for the crawl to finish, then yields every page
crawl = client.crawls.create(start_url="https://docs.olostep.com", max_pages=10)
for crawled in crawl.pages():
print(crawled.url, len(crawled.retrieve(["markdown"]).markdown_content or ""))
answer = client.answers.create(
task="When was the Eiffel Tower completed?", json_format={"year": ""}
)
print(json.loads(answer.json_content), answer.sources)
import Olostep from "olostep";
const client = new Olostep({ apiKey: process.env.OLOSTEP_API_KEY });
const page = await client.scrapes.create({ url: "https://example.com", formats: ["markdown"] });
console.log(page.markdown_content);
const siteMap = await client.maps.create({ url: "https://docs.olostep.com", topN: 100 });
for await (const url of siteMap.urls()) console.log(url);
const crawl = await client.crawls.create({ url: "https://docs.olostep.com", maxPages: 10 });
await crawl.waitTillDone();
for await (const crawled of crawl.pages()) {
const content = await client.retrieve.get(crawled.retrieve_id, ["markdown"]);
console.log(crawled.url, content.markdown_content?.length);
}
const answer = await client.answers.create({
task: "When was the Eiffel Tower completed?",
jsonFormat: { year: "" },
});
console.log(JSON.parse(answer.json_content), answer.sources);
HTTP API reference
Scrape
curl -X POST https://api.context.dev/v1/web/scrape \
-H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"formats": { "markdown": true, "html": true },
"sharedParams": { "mainContentOnly": true, "waitFor": 2000, "country": "IT" }
}'
curl -X POST https://api.olostep.com/v1/scrapes \
-H "Authorization: Bearer $OLOSTEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url_to_scrape": "https://example.com",
"formats": ["markdown", "html"],
"remove_css_selectors": "default",
"wait_before_scraping": 2000,
"country": "IT"
}'
| Context.dev | Olostep |
|---|---|
url | url_to_scrape |
formats: { "markdown": true, "html": true } | formats: ["markdown", "html"] |
formats.screenshot + screenshotParams.area: "fullPage" | formats: ["screenshot"] + screenshot: { "full_page": true } |
formats.json + jsonParams.schema | formats: ["json"] + llm_extract: { "schema": {...} } |
formats.json + jsonParams.instructions only | formats: ["json"] + llm_extract: { "prompt": "..." } |
formats.parse + prebuilt links parser | links_on_page: {} |
formats.parse + other prebuilt parsers | formats: ["json"] + parser: { "id": "@olostep/..." } (see Parsers; the parser set differs) |
sharedParams.mainContentOnly: true | remove_css_selectors: "default" (strips nav, footer, dialogs, banners) |
sharedParams.excludeSelectors: ["nav", ".ads"] | remove_css_selectors: "[\"nav\", \".ads\"]" (JSON string) |
sharedParams.waitFor (ms) | wait_before_scraping (ms) |
sharedParams.actions | actions (wait, click, fill_input, scroll) |
sharedParams.country | country |
sharedParams.viewport | screen_size: { "screen_width": 1920, "screen_height": 1080 } |
maxAgeMs | remove: Olostep fetches pages live |
sharedParams.includeSelectors, headers, profile, timeoutOpts | no equivalent |
| Context.dev | Olostep |
|---|---|
markdown.data | result.markdown_content |
html.data | result.html_content |
screenshot.data (base64 data URL) | result.screenshot_hosted_url (a URL) |
json.data (object) | result.json_content (string: parse it) |
parsed.data | result.json_content (parsers) or result.links_on_page (links) |
metadata.title | not reliably returned: read the <title> from result.html_content |
key_metadata.credits_consumed | credits_consumed |
request_id | id |
Map
curl "https://api.context.dev/v1/web/urls?domain=example.com&maxLinks=500&search=pricing" \
-H "Authorization: Bearer $CONTEXT_DEV_API_KEY"
curl -X POST https://api.olostep.com/v1/maps \
-H "Authorization: Bearer $OLOSTEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com", "top_n": 500, "search_query": "pricing" }'
| Context.dev | Olostep |
|---|---|
domain (query parameter, GET) | url (JSON body, POST) |
maxLinks (default 10,000) | top_n (omit it to get all URLs) |
search | search_query |
urlRegex / excludeUrlRegex (regex) | include_urls / exclude_urls (glob, e.g. /blog/**) |
includeSubdomains (default false) | include_subdomain (default true: set false to match Context.dev’s default) |
sitemapUrl | no equivalent |
Response urls: [{ "url", "title", ... }] | Response urls: ["https://..."] |
| — | cursor in the response when more URLs remain: send it back to get the next page |
Crawl
Context.dev’s/web/crawl is synchronous and returns every page in one response (up to 500 pages). Olostep’s crawl is a job: start it, wait for completed, then read the pages. The SDKs wait for you (crawl.pages() in Python, crawl.waitTillDone() in Node).
curl -X POST https://api.context.dev/v1/web/crawl \
-H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com", "maxPages": 50, "maxDepth": 3, "urlRegex": "^https://example\\.com/blog/" }'
# 1. Start the crawl
curl -X POST https://api.olostep.com/v1/crawls \
-H "Authorization: Bearer $OLOSTEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "start_url": "https://example.com", "max_pages": 50, "max_depth": 3, "include_urls": ["/blog/**"] }'
# 2. Poll until "status" is "completed"
curl https://api.olostep.com/v1/crawls/$CRAWL_ID -H "Authorization: Bearer $OLOSTEP_API_KEY"
# 3. List pages (each has a retrieve_id), then fetch each page's content
curl "https://api.olostep.com/v1/crawls/$CRAWL_ID/pages?limit=50" -H "Authorization: Bearer $OLOSTEP_API_KEY"
curl "https://api.olostep.com/v1/retrieve?retrieve_id=$RETRIEVE_ID&formats=markdown" -H "Authorization: Bearer $OLOSTEP_API_KEY"
| Context.dev | Olostep |
|---|---|
url | start_url |
maxPages (default 100, max 500) | max_pages (required) |
maxDepth | max_depth |
urlRegex / excludeUrlRegex (regex) | include_urls / exclude_urls (glob, e.g. /blog/**) |
followSubdomains | include_subdomain |
maxAgeMs, waitForMs, stopAfterMs, timeoutOpts | remove |
Response results[].markdown | /retrieve response markdown_content per page |
Response results[].metadata.url | pages[].url |
Search
curl -X POST https://api.context.dev/v1/web/search \
-H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "query": "best web scraping APIs", "numResults": 5, "markdownOptions": { "enabled": true } }'
curl -X POST https://api.olostep.com/v1/searches \
-H "Authorization: Bearer $OLOSTEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "query": "best web scraping APIs", "limit": 5, "scrape_options": { "formats": ["markdown"], "timeout": 45 } }'
| Context.dev | Olostep |
|---|---|
query | query |
numResults (1–100, default 10) | limit (1–25, default 12) |
includeDomains / excludeDomains | include_domains / exclude_domains |
markdownOptions.enabled: true | scrape_options: { "formats": ["markdown"], "timeout": 45 } (timeout in seconds, 1–60; links that don’t finish come back with null content) |
freshness | no equivalent: add the time frame to query |
country, languages, highlightsOptions | no equivalent |
zdr: "enabled" | zero_data_retention: true |
Response results[] (url, title, description) | result.links[] (url, title, description) |
Response results[].markdown.markdown | result.links[].markdown_content |
Response results[].relevance | no equivalent (results come in relevance order) |
Answers
The request shape is the same:task plus json_format as an example object.
Olostep
curl -X POST https://api.olostep.com/v1/answers \
-H "Authorization: Bearer $OLOSTEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "task": "Find the CEO and founding year of Stripe", "json_format": { "ceo": "", "founded": "" } }'
| Context.dev | Olostep |
|---|---|
task | task |
json_format (example object) | json_format (example object, or a plain-text description) |
mode: "fast" / "ultra" | no equivalent (omit) |
Response json_content (object) | result.json_content (string: parse it) |
Response sources | result.sources |
Batches
curl -X POST https://api.context.dev/v1/batch/submit \
-H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"mode": "scrape",
"data": {
"formats": { "markdown": true },
"urls": [
{ "url": "https://example.com", "itemId": "a" },
{ "url": "https://www.iana.org/help/example-domains", "itemId": "b" }
]
}
},
"webhook": { "url": "https://my.app/hook" }
}'
curl -X POST https://api.olostep.com/v1/batches \
-H "Authorization: Bearer $OLOSTEP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "custom_id": "a", "url": "https://example.com" },
{ "custom_id": "b", "url": "https://www.iana.org/help/example-domains" }
],
"webhook": "https://my.app/hook"
}'
| Context.dev | Olostep |
|---|---|
input.data.urls[] (url, itemId) | items[] (url, custom_id) |
input.data.formats | chosen when you read results: GET /retrieve?formats=markdown |
webhook.url | webhook (a string) |
GET /batch/{id} status (completed, failed, …) | GET /batches/{id} status (in_progress, completed) |
GET /batch/{id}/results (next_cursor) | GET /batches/{id}/items (cursor), then GET /retrieve?retrieve_id=... per item |
Result result.markdown.data | /retrieve response markdown_content |
itemId on each result | custom_id on each item |
Not covered one-to-one
These Context.dev endpoints have no Olostep equivalent: brand data (/brand/retrieve, /brand/search), /web/styleguide, /news/search, /scholar/search, /people/enrich, and /parse for uploaded files. Olostep scrapes PDFs and other documents by URL instead.
Verify the migration
- No Context.dev or Brand.dev imports, packages or
CONTEXT_DEV_API_KEYreads are left: search the code forcontext.dev,brand.devandContextDev. OLOSTEP_API_KEYis set wherever the app runs (local.env, CI secrets, production).formatsobjects ({ "markdown": true }) are now arrays (["markdown"]).- Code that read
.markdown.dataor.json.datanow readsmarkdown_contentor parsesjson_content. - Crawls wait for completion and read pages by
retrieve_id; URL filters use globs (/blog/**), not regex. - Run one scrape, one search and, if you use them, one crawl or batch end to end before deploying.