Context.dev

Pull live web pages, brand data, logos, and search results into Convex actions via the Context.dev API without maintaining scrapers.

Installation

npm install @context-dot-dev/convex

About Context.dev

Context.dev is a Convex component that wraps the Context.dev REST API, exposing it through typed Convex actions. It provides capabilities for web scraping, site crawling, structured data extraction, brand and logo lookup, and web search without requiring you to build or maintain scrapers. The component does not persist data in Convex; caching is handled by the Context.dev API via parameters like `maxAgeMs`.

Benefits

Use cases

how to scrape web pages from Convex actions

The Context.dev Convex component exposes scrapeMarkdown and scrapeHtml helper methods that can be called directly from Convex actions. Install @context-dot-dev/convex, configure your API key as a Convex environment variable, and call contextDev.scrapeMarkdown(ctx, { params: { url } }) to get clean Markdown back from any URL.

how to get company brand data and logos in Convex

The Context.dev component provides retrieveBrand, retrieveBrandByName, retrieveBrandByEmail, and retrieveBrandByTicker methods that return full brand payloads including logos, colors, and typography. Call these from a Convex action using the typed ContextDev client to enrich user or company records without building a scraper.

how to extract structured data from websites in Convex

The extract helper method crawls pages and extracts structured data based on a JSON schema you provide. This lets you run AI-powered data extraction pipelines entirely within Convex actions by calling contextDev.extract(ctx, { body: { schema, url } }).

how to run web search from a Convex backend function

The Context.dev Convex component includes a search method that queries the web with optional filters and can return results as Markdown. Call it from a Convex action to power RAG pipelines, research agents, or enrichment workflows without managing a separate search API integration.

Frequently asked questions

Does the Context.dev Convex component store scraped data in the Convex database?

No. The @context-dot-dev/convex component does not persist any data in Convex. It wraps the Context.dev REST API with typed helpers and isolated component actions. Caching behavior is controlled through API-level parameters such as maxAgeMs on individual requests, not through Convex storage.

How do I authenticate the Context.dev component with my API key?

Set your Context.dev API key as a Convex environment variable using npx convex env set CONTEXT_DEV_API_KEY your_api_key_here. Then wire the env variable through the component configuration in convex.config.ts using app.use(contextDev, { env: { CONTEXT_DEV_API_KEY: app.env.CONTEXT_DEV_API_KEY } }).

Can I call Context.dev component actions from Convex queries or mutations?

No. The Context.dev component methods must be called from Convex actions, not queries or mutations. This is because they make external HTTP requests to the Context.dev API, which is only permitted inside Convex actions per the Convex execution model.

What brand data fields does the Context.dev Convex component return?

The retrieveBrand method returns a full brand payload that includes logos, colors, typography, and design system details for a given domain. The retrieveSimplifiedBrand method returns a smaller subset of that payload. The styleguide and fonts methods can be used to extract specific design system details independently.

Does the Context.dev Convex component support looking up companies by stock ticker or ISIN?

Yes. The @context-dot-dev/convex package includes retrieveBrandByTicker and retrieveBrandByIsin helper methods for financial identifier lookups. There is also identifyBrandFromTransaction for matching a brand from transaction description text, and retrieveNaics and retrieveSic for industry classification.

Links