openapi: 3.1.0
info:
title: Context Brand Intelligence Web Extraction API
description: API for retrieving context data from any website
version: 1.0.0
servers:
- url: https://api.context.dev/v1
tags:
- name: Web Extraction
paths:
/web/extract:
post:
summary: Extract Structured Website Data
description: Crawl a website, use the provided JSON Schema and instructions to prioritize relevant internal links, and extract structured data from the selected pages.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
url:
type: string
format: uri
description: The starting website URL to crawl and extract from. Must include http:// or https://.
schema:
type: object
description: JSON Schema for the returned data object. TypeScript Zod users can pass a JSON Schema generated from a Zod object; Python users can pass the equivalent JSON Schema object.
additionalProperties: true
example:
type: object
properties:
mission_statement:
type: string
description: The company's stated mission.
case_studies:
type: array
items:
type: object
properties:
title:
type: string
url:
type: string
required:
- title
- url
additionalProperties: false
required:
- mission_statement
- case_studies
additionalProperties: false
instructions:
type: string
maxLength: 2000
description: Optional extraction guidance, such as which facts to prioritize or how to interpret fields in the schema.
factCheck:
type: boolean
default: false
description: When true, every returned value must be grounded in facts stated on the page; fields that cannot be supported by the page are returned as null/empty. When false (default), the model may make reasonable inferences and derivations from the page content (e.g. ideal customer, competitor analysis, recommendations) while keeping verifiable specifics (names, quotes, URLs, dates, metrics) faithful to the source.
followSubdomains:
type: boolean
default: false
description: When true, follow links on subdomains of the starting URL's domain.
maxPages:
type: integer
minimum: 1
maximum: 50
default: 5
description: 'Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5.'
maxDepth:
type: integer
minimum: 0
description: Optional maximum link depth from the starting URL (0 = only the starting page). If omitted, there is no crawl depth limit.
pdf:
type: object
properties:
shouldParse:
type: boolean
default: true
description: When true, PDF pages are fetched and parsed. When false, PDF pages are skipped.
start:
type: integer
minimum: 1
description: First 1-based PDF page to parse.
end:
type: integer
minimum: 1
description: Last 1-based PDF page to parse. Must be greater than or equal to start when both are provided.
additionalProperties: false
default:
shouldParse: true
includeFrames:
type: boolean
default: false
description: When true, iframe contents are included in Markdown before extraction.
maxAgeMs:
type: integer
minimum: 0
maximum: 2592000000
default: 604800000
description: Return cached scrape results if a prior scrape for the same parameters is younger than this many milliseconds. Defaults to 7 days (604800000 ms).
waitForMs:
type: integer
minimum: 0
maximum: 30000
description: Optional browser wait time in milliseconds after initial page load for each crawled page.
stopAfterMs:
type: integer
minimum: 10000
maximum: 110000
default: 80000
description: 'Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s).'
timeoutMS:
$ref: '#/components/schemas/TimeoutMS'
tags:
$ref: '#/components/schemas/RequestTags'
required:
- url
- schema
additionalProperties: false
security:
- bearerAuth: []
tags:
- Web Extraction
x-mint:
content: 10 Credits
title: Extract Structured Website Data
sidebarTitle: Extract structured data
description: Crawl a website, use the provided JSON Schema and instructions to prioritize relevant internal links, and extract structured data from the selected pages.
responses:
'200':
description: Successful response
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status of the response, e.g., 'ok'
url:
type: string
description: The starting URL that was analyzed
urls_analyzed:
type: array
description: List of URLs whose Markdown was used for extraction
items:
type: string
data:
type: object
description: Extracted data matching the request schema
additionalProperties: true
metadata:
type: object
properties:
numUrls:
type: integer
maxCrawlDepth:
type: integer
numSucceeded:
type: integer
numFailed:
type: integer
numSkipped:
type: integer
numBlocked:
type: integer
description: Number of crawled pages excluded because they were anti-bot challenges, error pages, or parked-domain placeholders.
required:
- numUrls
- maxCrawlDepth
- numSucceeded
- numFailed
- numSkipped
- numBlocked
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
required:
- status
- url
- urls_analyzed
- data
- metadata
'400':
description: Bad request - Invalid URL, schema, or inaccessible website
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
error_code:
type: string
enum:
- INPUT_VALIDATION_ERROR
- WEBSITE_ACCESS_ERROR
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
required:
- message
- error_code
'401':
description: Unauthorized - Invalid or missing API key
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Forbidden - Insufficient permissions or usage limit exceeded
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'408':
description: Request timeout
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
'500':
description: Internal server error
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-codeSamples:
- lang: JavaScript
source: "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.extract({\n schema: {\n type: 'bar',\n properties: 'bar',\n required: 'bar',\n additionalProperties: 'bar',\n },\n url: 'https://example.com',\n});\n\nconsole.log(response.data);"
- lang: Python
source: "import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get(\"CONTEXT_DEV_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.web.extract(\n schema={\n \"type\": \"bar\",\n \"properties\": \"bar\",\n \"required\": \"bar\",\n \"additionalProperties\": \"bar\",\n },\n url=\"https://example.com\",\n)\nprint(response.data)"
- lang: Go
source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/context-dot-dev/context-go-sdk\"\n\t\"github.com/context-dot-dev/context-go-sdk/option\"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Web.Extract(context.TODO(), contextdev.WebExtractParams{\n\t\tSchema: map[string]any{\n\t\t\t\"type\": \"bar\",\n\t\t\t\"properties\": \"bar\",\n\t\t\t\"required\": \"bar\",\n\t\t\t\"additionalProperties\": \"bar\",\n\t\t},\n\t\tURL: \"https://example.com\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
- lang: Ruby
source: "require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.web.extract(\n schema: {type: \"bar\", properties: \"bar\", required: \"bar\", additionalProperties: \"bar\"},\n url: \"https://example.com\"\n)\n\nputs(response)"
- lang: PHP
source: "web->extract(\n schema: [\n 'type' => 'bar',\n 'properties' => 'bar',\n 'required' => 'bar',\n 'additionalProperties' => 'bar',\n ],\n url: 'https://example.com',\n factCheck: true,\n followSubdomains: true,\n includeFrames: true,\n instructions: 'instructions',\n maxAgeMs: 0,\n maxDepth: 0,\n maxPages: 1,\n pdf: ['end' => 1, 'shouldParse' => true, 'start' => 1],\n stopAfterMs: 10000,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n waitForMs: 0,\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}"
- lang: CLI
source: "context-dev web extract \\\n --api-key 'My API Key' \\\n --schema '{type: bar, properties: bar, required: bar, additionalProperties: bar}' \\\n --url https://example.com"
/web/competitors:
get:
x-hidden: true
summary: Find website competitors
description: Analyze a company's landing page and web search evidence to return direct competitors for the same product or market.
security:
- bearerAuth: []
tags:
- Web Extraction
x-mint:
content: 10 Credits Private Alpha
title: Find website competitors
sidebarTitle: Find competitors
description: Analyze a company's website and web search evidence to return direct competitors.
parameters:
- schema:
type: string
minLength: 3
description: Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted and normalized to their domain.
required: true
description: Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted and normalized to their domain.
name: domain
in: query
- schema:
type: integer
minimum: 1
maximum: 10
default: 5
description: Exact number of direct competitors to return. Defaults to 5.
required: false
description: Exact number of direct competitors to return. Defaults to 5.
name: numCompetitors
in: query
- schema:
$ref: '#/components/schemas/TimeoutMS'
required: false
description: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
name: timeoutMS
in: query
- $ref: '#/components/parameters/RequestTags'
responses:
'200':
description: Competitor research succeeded.
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
status:
type: string
enum:
- ok
description: Status of the response.
domain:
type: string
description: Normalized input domain.
target:
type: object
description: Target company profile inferred from the landing page.
properties:
companyName:
type: string
description: Company or product name inferred from the landing page.
field:
type: string
description: Specific operating field, product category, or market.
fieldDescription:
type: string
description: One-sentence description of what the target company sells and who it serves.
websiteUrl:
type: string
description: Resolved URL used for the landing page analysis.
required:
- companyName
- field
- fieldDescription
- websiteUrl
additionalProperties: false
competitors:
type: array
description: Direct competitors ordered by relevance and confidence.
items:
type: object
properties:
name:
type: string
description: Competitor company or product name.
domain:
type: string
description: Competitor's normalized official domain.
url:
type: string
description: Competitor website URL.
description:
type: string
description: Short description of the competitor.
confidence:
type: string
enum:
- high
- medium
description: Confidence that this company is a direct competitor.
sourceUrls:
type: array
description: Search result URLs used as evidence for this competitor.
items:
type: string
required:
- name
- domain
- url
- description
- confidence
- sourceUrls
additionalProperties: false
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
required:
- status
- domain
- target
- competitors
additionalProperties: false
'400':
description: Bad request - Invalid parameters or inaccessible website
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
oneOf:
- type: string
- type: array
items:
type: object
description: Error message or validation details.
error_code:
type: string
enum:
- INPUT_VALIDATION_ERROR
- WEBSITE_ACCESS_ERROR
description: Error code indicating the type of error.
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
required:
- message
- error_code
'401':
description: Unauthorized - Invalid or missing API key
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message.
error_code:
type: string
enum:
- UNAUTHORIZED
description: Error code indicating unauthorized access.
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
required:
- message
- error_code
'403':
description: Forbidden - Insufficient permissions or usage limit exceeded
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message.
error_code:
type: string
enum:
- FORBIDDEN
- USAGE_EXCEEDED
- DISABLED
- INSUFFICIENT_PERMISSIONS
description: Error code indicating forbidden access.
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
required:
- message
- error_code
'408':
description: Request timeout
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Timeout error message.
error_code:
type: string
enum:
- REQUEST_TIMEOUT
description: Error code indicating request timeout.
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
required:
- message
- error_code
'429':
$ref: '#/components/responses/RateLimited'
'500':
description: Internal server error
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message.
error_code:
type: string
enum:
- INTERNAL_ERROR
description: Error code indicating internal server error.
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
required:
- message
- error_code
x-codeSamples:
- lang: JavaScript
source: "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.extractCompetitors({ domain: 'xxx' });\n\nconsole.log(response.competitors);"
- lang: Python
source: "import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get(\"CONTEXT_DEV_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.web.extract_competitors(\n domain=\"xxx\",\n)\nprint(response.competitors)"
- lang: Go
source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/context-dot-dev/context-go-sdk\"\n\t\"github.com/context-dot-dev/context-go-sdk/option\"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Web.ExtractCompetitors(context.TODO(), contextdev.WebExtractCompetitorsParams{\n\t\tDomain: \"xxx\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Competitors)\n}\n"
- lang: Ruby
source: 'require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.web.extract_competitors(domain: "xxx")
puts(response)'
- lang: PHP
source: "web->extractCompetitors(\n domain: 'xxx',\n numCompetitors: 1,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}"
- lang: CLI
source: "context-dev web extract-competitors \\\n --api-key 'My API Key' \\\n --domain xxx"
/web/styleguide:
get:
summary: Scrape Styleguide
description: Extract a comprehensive design system from a website including colors, typography, spacing, shadows, and UI components.
x-oneOf-query:
- title: By Domain
required:
- domain
properties:
domain:
type: string
description: Domain name to extract styleguide from (e.g., 'example.com', 'google.com').
maxAgeMs:
type: integer
minimum: 86400000
maximum: 31536000000
default: 7776000000
description: Maximum age in milliseconds for cached styleguide data before a hard refresh. Defaults to 3 months. Ignored when 'directUrl' is used.
colorScheme:
type: string
enum:
- light
- dark
description: Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.
timeoutMS:
$ref: '#/components/schemas/TimeoutMS'
- title: By Direct URL
required:
- directUrl
properties:
directUrl:
type: string
format: uri
description: A specific URL to fetch the styleguide from directly, bypassing domain resolution.
colorScheme:
type: string
enum:
- light
- dark
description: Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.
timeoutMS:
$ref: '#/components/schemas/TimeoutMS'
security:
- bearerAuth: []
tags:
- Web Extraction
x-mint:
content: 10 Credits
title: Scrape Styleguide
sidebarTitle: Scrape styleguide
description: Extract a comprehensive design system from a website including colors, typography, spacing, shadows, and UI components.
parameters:
- schema:
type: string
minLength: 3
description: Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
required: false
description: Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
name: domain
in: query
- schema:
type: string
format: uri
description: A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, the styleguide is extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.
required: false
description: A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, the styleguide is extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.
name: directUrl
in: query
- schema:
type:
- integer
- 'null'
default: 7776000000
description: Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.
required: false
description: Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.
name: maxAgeMs
in: query
- schema:
$ref: '#/components/schemas/TimeoutMS'
required: false
description: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
name: timeoutMS
in: query
- schema:
type: string
enum:
- light
- dark
description: Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.
required: false
description: Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.
name: colorScheme
in: query
- $ref: '#/components/parameters/RequestTags'
responses:
'200':
description: Successful response
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status of the response, e.g., 'ok'
domain:
type: string
description: The normalized domain that was processed
styleguide:
type: object
description: Comprehensive styleguide data extracted from the website
required:
- mode
- colors
- typography
- elementSpacing
- shadows
- components
- fontLinks
properties:
mode:
type: string
enum:
- light
- dark
description: The primary color mode of the website design
colors:
type: object
description: Primary colors used on the website
required:
- accent
- background
- text
properties:
accent:
type: string
description: Accent color (hex format)
background:
type: string
description: Background color (hex format)
text:
type: string
description: Text color (hex format)
typography:
type: object
description: Typography styles used on the website
required:
- headings
properties:
headings:
type: object
description: Heading styles
properties:
h1:
type: object
required:
- fontFamily
- fontFallbacks
- fontSize
- fontWeight
- lineHeight
- letterSpacing
properties:
fontFamily:
type: string
description: Primary face (first family in the computed stack)
fontFallbacks:
type: array
items:
type: string
description: Full ordered font list from resolved computed font-family
fontSize:
type: string
fontWeight:
type: number
lineHeight:
type: string
letterSpacing:
type: string
h2:
type: object
required:
- fontFamily
- fontFallbacks
- fontSize
- fontWeight
- lineHeight
- letterSpacing
properties:
fontFamily:
type: string
description: Primary face (first family in the computed stack)
fontFallbacks:
type: array
items:
type: string
description: Full ordered font list from resolved computed font-family
fontSize:
type: string
fontWeight:
type: number
lineHeight:
type: string
letterSpacing:
type: string
h3:
type: object
required:
- fontFamily
- fontFallbacks
- fontSize
- fontWeight
- lineHeight
- letterSpacing
properties:
fontFamily:
type: string
description: Primary face (first family in the computed stack)
fontFallbacks:
type: array
items:
type: string
description: Full ordered font list from resolved computed font-family
fontSize:
type: string
fontWeight:
type: number
lineHeight:
type: string
letterSpacing:
type: string
h4:
type: object
required:
- fontFamily
- fontFallbacks
- fontSize
- fontWeight
- lineHeight
- letterSpacing
properties:
fontFamily:
type: string
description: Primary face (first family in the computed stack)
fontFallbacks:
type: array
items:
type: string
description: Full ordered font list from resolved computed font-family
fontSize:
type: string
fontWeight:
type: number
lineHeight:
type: string
letterSpacing:
type: string
p:
type: object
required:
- fontFamily
- fontFallbacks
- fontSize
- fontWeight
- lineHeight
- letterSpacing
properties:
fontFamily:
type: string
description: Primary face (first family in the computed stack)
fontFallbacks:
type: array
items:
type: string
description: Full ordered font list from resolved computed font-family
fontSize:
type: string
fontWeight:
type: number
lineHeight:
type: string
letterSpacing:
type: string
elementSpacing:
type: object
description: Spacing system used on the website
required:
- xs
- sm
- md
- lg
- xl
properties:
xs:
type: string
sm:
type: string
md:
type: string
lg:
type: string
xl:
type: string
shadows:
type: object
description: Shadow styles used on the website
required:
- sm
- md
- lg
- xl
- inner
properties:
sm:
type: string
md:
type: string
lg:
type: string
xl:
type: string
inner:
type: string
fontLinks:
type: object
description: Font assets keyed by family name as it appears in fontFamily/fontFallbacks (non-generic names only). Clients match typography.fontFamily / fontWeight or button styles to pick a file URL from files.
additionalProperties:
type: object
required:
- type
- files
properties:
type:
type: string
enum:
- google
- custom
files:
type: object
additionalProperties:
type: string
description: Upright font files keyed by weight string (e.g. "400" for regular, "500", "700"). Values are absolute URLs.
category:
type: string
description: Google Fonts category when type is google (e.g. sans-serif, serif, monospace, display, handwriting). Omitted for custom fonts when unknown.
displayName:
type: string
description: 'Present when type is custom: human-readable name derived from the fontLinks key (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). Google entries omit this.'
components:
type: object
description: UI component styles
required:
- button
properties:
button:
type: object
description: Button component styles
properties:
primary:
type: object
required:
- backgroundColor
- color
- borderColor
- borderRadius
- borderWidth
- borderStyle
- padding
- minWidth
- minHeight
- fontSize
- fontWeight
- textDecoration
- boxShadow
- css
properties:
backgroundColor:
type: string
color:
type: string
borderColor:
type: string
description: 'Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alpha)'
borderRadius:
type: string
borderWidth:
type: string
borderStyle:
type: string
padding:
type: string
minWidth:
type: string
description: Sampled minimum width of the button box (typically px)
minHeight:
type: string
description: Sampled minimum height of the button box (typically px)
fontSize:
type: string
fontWeight:
type: number
fontFamily:
type: string
description: Primary button typeface (first in fontFallbacks)
fontFallbacks:
type: array
items:
type: string
description: Full ordered font list from computed font-family
textDecoration:
type: string
textDecorationColor:
type: string
description: Hex color of the underline when it differs from the text color
boxShadow:
type: string
description: Computed box-shadow (comma-separated layers when present)
css:
type: string
description: Ready-to-use CSS declaration block for this component style
secondary:
type: object
required:
- backgroundColor
- color
- borderColor
- borderRadius
- borderWidth
- borderStyle
- padding
- minWidth
- minHeight
- fontSize
- fontWeight
- textDecoration
- boxShadow
- css
properties:
backgroundColor:
type: string
color:
type: string
borderColor:
type: string
description: 'Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alpha)'
borderRadius:
type: string
borderWidth:
type: string
borderStyle:
type: string
padding:
type: string
minWidth:
type: string
description: Sampled minimum width of the button box (typically px)
minHeight:
type: string
description: Sampled minimum height of the button box (typically px)
fontSize:
type: string
fontWeight:
type: number
fontFamily:
type: string
description: Primary button typeface (first in fontFallbacks)
fontFallbacks:
type: array
items:
type: string
description: Full ordered font list from computed font-family
textDecoration:
type: string
textDecorationColor:
type: string
description: Hex color of the underline when it differs from the text color
boxShadow:
type: string
description: Computed box-shadow (comma-separated layers when present)
css:
type: string
description: Ready-to-use CSS declaration block for this component style
link:
type: object
required:
- backgroundColor
- color
- borderColor
- borderRadius
- borderWidth
- borderStyle
- padding
- minWidth
- minHeight
- fontSize
- fontWeight
- textDecoration
- boxShadow
- css
properties:
backgroundColor:
type: string
color:
type: string
borderColor:
type: string
description: 'Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alpha)'
borderRadius:
type: string
borderWidth:
type: string
borderStyle:
type: string
padding:
type: string
minWidth:
type: string
description: Sampled minimum width of the button box (typically px)
minHeight:
type: string
description: Sampled minimum height of the button box (typically px)
fontSize:
type: string
fontWeight:
type: number
fontFamily:
type: string
description: Primary button typeface (first in fontFallbacks)
fontFallbacks:
type: array
items:
type: string
description: Full ordered font list from computed font-family
textDecoration:
type: string
textDecorationColor:
type: string
description: Hex color of the underline when it differs from the text color
boxShadow:
type: string
description: Computed box-shadow (comma-separated layers when present)
css:
type: string
description: Ready-to-use CSS declaration block for this component style
card:
type: object
description: Card component style
required:
- backgroundColor
- borderColor
- borderRadius
- borderWidth
- borderStyle
- padding
- boxShadow
- textColor
- css
properties:
backgroundColor:
type: string
borderColor:
type: string
description: 'Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alpha)'
borderRadius:
type: string
borderWidth:
type: string
borderStyle:
type: string
padding:
type: string
boxShadow:
type: string
textColor:
type: string
css:
type: string
description: Ready-to-use CSS declaration block for this component style
code:
type: integer
description: HTTP status code
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'400':
description: Bad Request
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- INPUT_VALIDATION_ERROR
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'401':
description: Unauthorized
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- INPUT_VALIDATION_ERROR
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'408':
description: Request Timeout
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Timeout error message
error_code:
type: string
enum:
- REQUEST_TIMEOUT
description: Error code indicating request timeout
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'429':
$ref: '#/components/responses/RateLimited'
'500':
description: Internal server error
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- INTERNAL_ERROR
description: Error code indicating internal server error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
x-codeSamples:
- lang: JavaScript
source: "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.extractStyleguide();\n\nconsole.log(response.styleguide);"
- lang: Python
source: "import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get(\"CONTEXT_DEV_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.web.extract_styleguide()\nprint(response.styleguide)"
- lang: Go
source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/context-dot-dev/context-go-sdk\"\n\t\"github.com/context-dot-dev/context-go-sdk/option\"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Web.ExtractStyleguide(context.TODO(), contextdev.WebExtractStyleguideParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Styleguide)\n}\n"
- lang: Ruby
source: 'require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.web.extract_styleguide
puts(response)'
- lang: PHP
source: "web->extractStyleguide(\n colorScheme: 'light',\n directURL: 'https://example.com',\n domain: 'xxx',\n maxAgeMs: 0,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}"
- lang: CLI
source: "context-dev web extract-styleguide \\\n --api-key 'My API Key'"
/web/fonts:
get:
summary: Scrape Fonts
description: Scrape font information from a website including font families, usage statistics, fallbacks, and element/word counts.
x-oneOf-query:
- title: By Domain
required:
- domain
properties:
domain:
type: string
description: Domain name to extract fonts from (e.g., 'example.com', 'google.com').
maxAgeMs:
type: integer
minimum: 86400000
maximum: 31536000000
default: 7776000000
description: Maximum age in milliseconds for cached font data before a hard refresh. Defaults to 3 months. Ignored when 'directUrl' is used.
timeoutMS:
$ref: '#/components/schemas/TimeoutMS'
- title: By Direct URL
required:
- directUrl
properties:
directUrl:
type: string
format: uri
description: A specific URL to fetch fonts from directly, bypassing domain resolution.
timeoutMS:
$ref: '#/components/schemas/TimeoutMS'
security:
- bearerAuth: []
tags:
- Web Extraction
x-mint:
content: 5 Credits
title: Scrape Fonts
sidebarTitle: Scrape fonts
description: Scrape font information from a website including font families, usage statistics, fallbacks, and element/word counts.
parameters:
- schema:
type: string
format: uri
description: A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, fonts are extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.
required: false
description: A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, fonts are extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.
name: directUrl
in: query
- schema:
type: string
minLength: 3
description: Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
required: false
description: Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
name: domain
in: query
- schema:
type:
- integer
- 'null'
default: 7776000000
description: Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.
required: false
description: Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.
name: maxAgeMs
in: query
- schema:
$ref: '#/components/schemas/TimeoutMS'
required: false
description: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
name: timeoutMS
in: query
- $ref: '#/components/parameters/RequestTags'
responses:
'200':
description: Successful response
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status of the response, e.g., 'ok'
domain:
type: string
description: The normalized domain that was processed
fonts:
type: array
description: Array of font usage information
items:
type: object
properties:
font:
type: string
description: Font family name
uses:
type: array
items:
type: string
description: Array of CSS selectors or element types where this font is used
fallbacks:
type: array
items:
type: string
description: Array of fallback font families
num_elements:
type: number
description: Number of elements using this font
num_words:
type: number
description: Number of words using this font
percent_words:
type: number
description: Percentage of words using this font
percent_elements:
type: number
description: Percentage of elements using this font
required:
- font
- uses
- fallbacks
- num_elements
- num_words
- percent_words
- percent_elements
fontLinks:
type: object
description: Font assets keyed by family name as it appears in the fonts array (non-generic names only). Clients match entries in fonts to pick a file URL from files. Omitted when no families resolve to Google or custom @font-face URLs.
additionalProperties:
type: object
required:
- type
- files
properties:
type:
type: string
enum:
- google
- custom
files:
type: object
additionalProperties:
type: string
description: Upright font files keyed by weight string (e.g. "400" for regular, "500", "700"). Values are absolute URLs.
category:
type: string
description: Google Fonts category when type is google (e.g. sans-serif, serif, monospace, display, handwriting). Omitted for custom fonts when unknown.
displayName:
type: string
description: 'Present when type is custom: human-readable name derived from the fontLinks key (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). Google entries omit this.'
code:
type: integer
description: HTTP status code, e.g., 200
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
required:
- status
- domain
- fonts
- code
'400':
description: Bad request - Invalid input parameters
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message describing the validation error
error_code:
type: string
enum:
- INPUT_VALIDATION_ERROR
description: Error code indicating input validation error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'401':
description: Unauthorized - Invalid or missing API key
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- UNAUTHORIZED
description: Error code indicating unauthorized access
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'403':
description: Forbidden - Insufficient permissions or usage limit exceeded
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- FORBIDDEN
- USAGE_EXCEEDED
- DISABLED
- INSUFFICIENT_PERMISSIONS
description: Error code indicating forbidden access
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'408':
description: Request timeout
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Timeout error message
error_code:
type: string
enum:
- REQUEST_TIMEOUT
description: Error code indicating request timeout
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'429':
$ref: '#/components/responses/RateLimited'
'500':
description: Internal server error
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- INTERNAL_ERROR
description: Error code indicating internal server error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
x-codeSamples:
- lang: JavaScript
source: "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.web.extractFonts();\n\nconsole.log(response.code);"
- lang: Python
source: "import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get(\"CONTEXT_DEV_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.web.extract_fonts()\nprint(response.code)"
- lang: Go
source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/context-dot-dev/context-go-sdk\"\n\t\"github.com/context-dot-dev/context-go-sdk/option\"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Web.ExtractFonts(context.TODO(), contextdev.WebExtractFontsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Code)\n}\n"
- lang: Ruby
source: 'require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.web.extract_fonts
puts(response)'
- lang: PHP
source: "web->extractFonts(\n directURL: 'https://example.com',\n domain: 'xxx',\n maxAgeMs: 0,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}"
- lang: CLI
source: "context-dev web extract-fonts \\\n --api-key 'My API Key'"
/web/naics:
get:
summary: Classify NAICS industries
description: Classify any brand into 2022 NAICS industry codes from its domain or name.
security:
- bearerAuth: []
tags:
- Web Extraction
x-mint:
content: 10 Credits
title: Classify NAICS industries
sidebarTitle: Classify NAICS industries
description: Classify any brand into 2022 NAICS industry codes from its domain or name.
parameters:
- schema:
type: string
minLength: 4
description: Brand domain or title to retrieve NAICS code for. If a valid domain is provided, it will be used for classification, otherwise, we will search for the brand using the provided title.
required: true
description: Brand domain or title to retrieve NAICS code for. If a valid domain is provided, it will be used for classification, otherwise, we will search for the brand using the provided title.
name: input
in: query
- schema:
type: integer
minimum: 1
maximum: 10
default: 1
description: Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
required: false
description: Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
name: minResults
in: query
- schema:
type: integer
minimum: 1
maximum: 10
default: 5
description: Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5.
required: false
description: Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults to 5.
name: maxResults
in: query
- schema:
$ref: '#/components/schemas/TimeoutMS'
required: false
description: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
name: timeoutMS
in: query
- $ref: '#/components/parameters/RequestTags'
responses:
'200':
description: Successful response
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status of the response, e.g., 'ok'
domain:
type: string
description: Domain found for the brand
type:
type: string
description: Industry classification type, for naics api it will be `naics`
codes:
type: array
description: Array of NAICS codes and titles.
items:
type: object
properties:
code:
type: string
description: NAICS code
name:
type: string
description: NAICS title
confidence:
type: string
enum:
- high
- medium
- low
description: Confidence level for how well this NAICS code matches the company description
required:
- code
- name
- confidence
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'400':
description: Bad Request
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- INPUT_VALIDATION_ERROR
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'401':
description: Unauthorized
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- INPUT_VALIDATION_ERROR
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'404':
description: Brand not found.
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'408':
description: Request Timeout
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Timeout error message
error_code:
type: string
enum:
- REQUEST_TIMEOUT
description: Error code indicating request timeout
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'429':
$ref: '#/components/responses/RateLimited'
x-codeSamples:
- lang: JavaScript
source: "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.industry.retrieveNaics({ input: 'xxxx' });\n\nconsole.log(response.codes);"
- lang: Python
source: "import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get(\"CONTEXT_DEV_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.industry.retrieve_naics(\n input=\"xxxx\",\n)\nprint(response.codes)"
- lang: Go
source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/context-dot-dev/context-go-sdk\"\n\t\"github.com/context-dot-dev/context-go-sdk/option\"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Industry.GetNaics(context.TODO(), contextdev.IndustryGetNaicsParams{\n\t\tInput: \"xxxx\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Codes)\n}\n"
- lang: Ruby
source: 'require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.industry.retrieve_naics(input: "xxxx")
puts(response)'
- lang: PHP
source: "industry->retrieveNaics(\n input: 'xxxx',\n maxResults: 1,\n minResults: 1,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}"
- lang: CLI
source: "context-dev industry retrieve-naics \\\n --api-key 'My API Key' \\\n --input xxxx"
/web/sic:
get:
summary: Classify SIC industries
description: Classify any brand into Standard Industrial Classification (SIC) codes from its domain or name. Choose between the original SIC system (`original_sic`) or the latest SIC list maintained by the SEC (`latest_sec`).
security:
- bearerAuth: []
tags:
- Web Extraction
x-mint:
content: 10 Credits
title: Classify SIC industries
sidebarTitle: Classify SIC industries
description: Classify any brand into Standard Industrial Classification (SIC) codes from its domain or name.
parameters:
- schema:
type: string
minLength: 4
description: Brand domain or title to retrieve SIC code for. If a valid domain is provided, it will be used for classification, otherwise, we will search for the brand using the provided title.
required: true
description: Brand domain or title to retrieve SIC code for. If a valid domain is provided, it will be used for classification, otherwise, we will search for the brand using the provided title.
name: input
in: query
- schema:
type: string
enum:
- original_sic
- latest_sec
default: original_sic
description: Which SIC dataset to classify against. `original_sic` uses the 1987 Standard Industrial Classification system; `latest_sec` uses the current SIC list as published by the SEC. Defaults to `original_sic`.
required: false
description: Which SIC dataset to classify against. `original_sic` uses the 1987 Standard Industrial Classification system; `latest_sec` uses the current SIC list as published by the SEC. Defaults to `original_sic`.
name: type
in: query
- schema:
type: integer
minimum: 1
maximum: 10
default: 1
description: Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.
required: false
description: Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.
name: minResults
in: query
- schema:
type: integer
minimum: 1
maximum: 10
default: 5
description: Maximum number of SIC codes to return. Must be between 1 and 10. Defaults to 5.
required: false
description: Maximum number of SIC codes to return. Must be between 1 and 10. Defaults to 5.
name: maxResults
in: query
- schema:
$ref: '#/components/schemas/TimeoutMS'
required: false
description: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
name: timeoutMS
in: query
- $ref: '#/components/parameters/RequestTags'
responses:
'200':
description: Successful response
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status of the response, e.g., 'ok'
domain:
type: string
description: Domain found for the brand
type:
type: string
description: Industry classification type, for sic api it will be `sic`
classification:
type: string
enum:
- original_sic
- latest_sec
description: Echoes back which SIC dataset was used to classify the brand.
codes:
type: array
description: 'Array of SIC codes with confidence scores. Extra fields depend on the requested classification: `original_sic` results include `majorGroup` and `majorGroupName`; `latest_sec` results include `office`.'
items:
type: object
properties:
code:
type: string
description: SIC code (4-digit).
name:
type: string
description: SIC industry title.
confidence:
type: string
enum:
- high
- medium
- low
description: Confidence level for how well this SIC code matches the company description.
majorGroup:
type: string
description: 2-digit major group identifier (the leading two digits of the code). Only present when `classification` is `original_sic`.
majorGroupName:
type: string
description: Description of the 2-digit major group. Only present when `classification` is `original_sic`.
office:
type: string
description: SEC review office responsible for filings under this code. Only present when `classification` is `latest_sec`.
required:
- code
- name
- confidence
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'400':
description: Bad Request
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- INPUT_VALIDATION_ERROR
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'401':
description: Unauthorized
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- INPUT_VALIDATION_ERROR
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'404':
description: Brand not found.
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'408':
description: Request Timeout
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Timeout error message
error_code:
type: string
enum:
- REQUEST_TIMEOUT
description: Error code indicating request timeout
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'429':
$ref: '#/components/responses/RateLimited'
x-codeSamples:
- lang: JavaScript
source: "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.industry.retrieveSic({ input: 'xxxx' });\n\nconsole.log(response.classification);"
- lang: Python
source: "import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get(\"CONTEXT_DEV_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.industry.retrieve_sic(\n input=\"xxxx\",\n)\nprint(response.classification)"
- lang: Go
source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/context-dot-dev/context-go-sdk\"\n\t\"github.com/context-dot-dev/context-go-sdk/option\"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Industry.GetSic(context.TODO(), contextdev.IndustryGetSicParams{\n\t\tInput: \"xxxx\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Classification)\n}\n"
- lang: Ruby
source: 'require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.industry.retrieve_sic(input: "xxxx")
puts(response)'
- lang: PHP
source: "industry->retrieveSic(\n input: 'xxxx',\n maxResults: 1,\n minResults: 1,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n type: 'original_sic',\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}"
- lang: CLI
source: "context-dev industry retrieve-sic \\\n --api-key 'My API Key' \\\n --input xxxx"
/brand/ai/query:
post:
x-hidden: true
summary: Query website data using AI
description: Use AI to extract specific data points from a brand's website. The AI will crawl the website and extract the requested information based on the provided data points.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- domain
- data_to_extract
properties:
domain:
type: string
description: The domain name to analyze
specific_pages:
type: object
description: Optional object specifying which pages to analyze
properties:
home_page:
type: boolean
description: Whether to analyze the home page
blog:
type: boolean
description: Whether to analyze the blog
terms_and_conditions:
type: boolean
description: Whether to analyze the terms and conditions page
privacy_policy:
type: boolean
description: Whether to analyze the privacy policy page
about_us:
type: boolean
description: Whether to analyze the about us page
contact_us:
type: boolean
description: Whether to analyze the contact us page
careers:
type: boolean
description: Whether to analyze the careers page
faq:
type: boolean
description: Whether to analyze the FAQ page
pricing:
type: boolean
description: Whether to analyze the pricing page
data_to_extract:
type: array
description: Array of data points to extract from the website
items:
type: object
required:
- datapoint_name
- datapoint_type
- datapoint_description
- datapoint_example
properties:
datapoint_name:
type: string
description: Name of the data point to extract
datapoint_type:
type: string
enum:
- text
- number
- date
- boolean
- list
- url
description: Type of the data point
datapoint_list_type:
type: string
enum:
- string
- text
- number
- date
- boolean
- list
- url
- object
default: string
description: Type of items in the list when datapoint_type is 'list'. Defaults to 'string'. Use 'object' to extract an array of objects matching a schema.
datapoint_object_schema:
type: object
description: Schema definition for objects when datapoint_list_type is 'object'. Provide a map of field names to their scalar types.
additionalProperties:
type: string
enum:
- string
- number
- date
- boolean
minProperties: 1
example:
testimonial_text: string
testimonial_author: string
datapoint_description:
type: string
description: Description of what to extract
datapoint_example:
type: string
description: Example of the expected value
timeoutMS:
$ref: '#/components/schemas/TimeoutMS'
tags:
$ref: '#/components/schemas/RequestTags'
security:
- bearerAuth: []
tags:
- Web Extraction
x-mint:
content: 10 Credits
responses:
'200':
description: Successful response
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status of the response, e.g., 'ok'
domain:
type: string
description: The domain that was analyzed
urls_analyzed:
type: array
description: List of URLs that were analyzed
items:
type: string
data_extracted:
type: array
description: Array of extracted data points
items:
type: object
properties:
datapoint_name:
type: string
description: Name of the extracted data point
datapoint_value:
oneOf:
- type: string
- type: number
- type: boolean
- type: array
items:
type: string
- type: array
items:
type: number
- type: array
items:
type: object
description: Value of the extracted data point. Can be a primitive type, an array of primitives, or an array of objects when datapoint_list_type is 'object'.
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'400':
description: Bad Request - validation error
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- INPUT_VALIDATION_ERROR
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'401':
description: Unauthorized
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- INPUT_VALIDATION_ERROR
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'408':
description: Request Timeout
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Timeout error message
error_code:
type: string
enum:
- REQUEST_TIMEOUT
description: Error code indicating request timeout
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'429':
$ref: '#/components/responses/RateLimited'
'500':
description: Internal server error
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- INTERNAL_ERROR
description: Error code indicating internal server error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
/brand/ai/product:
post:
summary: Extract a single product from a URL
description: Given a single URL, determines if it is a product page and extracts the product information.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- url
properties:
url:
type: string
format: uri
description: The product page URL to extract product data from.
maxAgeMs:
type: integer
minimum: 0
maximum: 2592000000
default: 604800000
description: Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 7 days (604800000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
timeoutMS:
$ref: '#/components/schemas/TimeoutMS'
tags:
$ref: '#/components/schemas/RequestTags'
security:
- bearerAuth: []
tags:
- Web Extraction
x-mint:
content: 10 Credits
responses:
'200':
description: Successful response
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
is_product_page:
type: boolean
description: Whether the given URL is a product detail page
platform:
type:
- string
- 'null'
enum:
- amazon
- tiktok_shop
- etsy
- generic
- null
description: The detected ecommerce platform, or null if not a product page
product:
type:
- object
- 'null'
description: The extracted product data, or null if not a product page
properties:
name:
type: string
description: Name of the product
description:
type: string
description: Description of the product
price:
type:
- number
- 'null'
description: Price of the product
currency:
type:
- string
- 'null'
description: Currency code for the price (e.g., USD, EUR)
billing_frequency:
type:
- string
- 'null'
enum:
- monthly
- yearly
- one_time
- usage_based
- null
description: Billing frequency for the product
pricing_model:
type:
- string
- 'null'
enum:
- per_seat
- flat
- tiered
- freemium
- custom
- null
description: Pricing model for the product
url:
type:
- string
- 'null'
description: URL to the product page
category:
type:
- string
- 'null'
description: Category of the product
features:
type: array
description: List of product features
items:
type: string
target_audience:
type: array
description: Target audience for the product (array of strings)
items:
type: string
tags:
type: array
description: Tags associated with the product
items:
type: string
image_url:
type:
- string
- 'null'
description: URL to the product image
images:
type: array
description: URLs to product images on the page (up to 7)
items:
type: string
sku:
type:
- string
- 'null'
description: Stock Keeping Unit (product identifier). Null if no identifier is found.
required:
- name
- description
- features
- target_audience
- tags
- images
- sku
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'400':
description: Bad Request - validation error
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- INPUT_VALIDATION_ERROR
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'401':
description: Unauthorized
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- INPUT_VALIDATION_ERROR
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'408':
description: Request Timeout
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Timeout error message
error_code:
type: string
enum:
- REQUEST_TIMEOUT
description: Error code indicating request timeout
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'429':
$ref: '#/components/responses/RateLimited'
'500':
description: Internal server error
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- INTERNAL_ERROR
description: Error code indicating internal server error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
x-codeSamples:
- lang: JavaScript
source: "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.ai.extractProduct({ url: 'https://example.com' });\n\nconsole.log(response.is_product_page);"
- lang: Python
source: "import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get(\"CONTEXT_DEV_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.ai.extract_product(\n url=\"https://example.com\",\n)\nprint(response.is_product_page)"
- lang: Go
source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/context-dot-dev/context-go-sdk\"\n\t\"github.com/context-dot-dev/context-go-sdk/option\"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.AI.ExtractProduct(context.TODO(), contextdev.AIExtractProductParams{\n\t\tURL: \"https://example.com\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.IsProductPage)\n}\n"
- lang: Ruby
source: 'require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.ai.extract_product(url: "https://example.com")
puts(response)'
- lang: PHP
source: "ai->extractProduct(\n url: 'https://example.com',\n maxAgeMs: 0,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}"
- lang: CLI
source: "context-dev ai extract-product \\\n --api-key 'My API Key' \\\n --url https://example.com"
/brand/ai/products:
post:
summary: Extract products from a brand's website
description: Extract product information from a brand's website. We will analyze the website and return a list of products with details such as name, description, image, pricing, features, and more.
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- title: By Domain
type: object
required:
- domain
properties:
domain:
type: string
description: The domain name to analyze.
maxProducts:
type: integer
minimum: 1
maximum: 12
description: Maximum number of products to extract.
maxAgeMs:
type: integer
minimum: 0
maximum: 2592000000
default: 604800000
description: Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 7 days (604800000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
timeoutMS:
$ref: '#/components/schemas/TimeoutMS'
tags:
$ref: '#/components/schemas/RequestTags'
- title: By Direct URL
type: object
required:
- directUrl
properties:
directUrl:
type: string
format: uri
description: A specific URL to use directly as the starting point for extraction without domain resolution.
maxProducts:
type: integer
minimum: 1
maximum: 12
description: Maximum number of products to extract.
maxAgeMs:
type: integer
minimum: 0
maximum: 2592000000
default: 604800000
description: Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 7 days (604800000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
timeoutMS:
$ref: '#/components/schemas/TimeoutMS'
tags:
$ref: '#/components/schemas/RequestTags'
security:
- bearerAuth: []
tags:
- Web Extraction
x-mint:
content: 10 Credits Beta Feature
responses:
'200':
description: Successful response
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
products:
type: array
description: Array of products extracted from the website
items:
type: object
properties:
name:
type: string
description: Name of the product
description:
type: string
description: Description of the product
price:
type:
- number
- 'null'
description: Price of the product
currency:
type:
- string
- 'null'
description: Currency code for the price (e.g., USD, EUR)
billing_frequency:
type:
- string
- 'null'
enum:
- monthly
- yearly
- one_time
- usage_based
- null
description: Billing frequency for the product
pricing_model:
type:
- string
- 'null'
enum:
- per_seat
- flat
- tiered
- freemium
- custom
- null
description: Pricing model for the product
url:
type:
- string
- 'null'
description: URL to the product page
category:
type:
- string
- 'null'
description: Category of the product
features:
type: array
description: List of product features
items:
type: string
target_audience:
type: array
description: Target audience for the product (array of strings)
items:
type: string
tags:
type: array
description: Tags associated with the product
items:
type: string
image_url:
type:
- string
- 'null'
description: URL to the product image
images:
type: array
description: URLs to product images on the page (up to 7)
items:
type: string
sku:
type:
- string
- 'null'
description: Stock Keeping Unit (product identifier). Null if no identifier is found.
required:
- name
- description
- features
- target_audience
- tags
- images
- sku
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'400':
description: Bad Request - validation error
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- INPUT_VALIDATION_ERROR
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'401':
description: Unauthorized
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- INPUT_VALIDATION_ERROR
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'408':
description: Request Timeout
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Timeout error message
error_code:
type: string
enum:
- REQUEST_TIMEOUT
description: Error code indicating request timeout
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
'429':
$ref: '#/components/responses/RateLimited'
'500':
description: Internal server error
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- INTERNAL_ERROR
description: Error code indicating internal server error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
x-codeSamples:
- lang: JavaScript
source: "import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.ai.extractProducts({ domain: 'domain' });\n\nconsole.log(response.key_metadata);"
- lang: Python
source: "import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get(\"CONTEXT_DEV_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.ai.extract_products(\n domain=\"domain\",\n)\nprint(response.key_metadata)"
- lang: Go
source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/context-dot-dev/context-go-sdk\"\n\t\"github.com/context-dot-dev/context-go-sdk/option\"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.AI.ExtractProducts(context.TODO(), contextdev.AIExtractProductsParams{\n\t\tOfByDomain: &contextdev.AIExtractProductsParamsBodyByDomain{\n\t\t\tDomain: \"domain\",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.KeyMetadata)\n}\n"
- lang: Ruby
source: 'require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.ai.extract_products(body: {domain: "domain"})
puts(response)'
- lang: PHP
source: "ai->extractProducts(\n domain: 'domain',\n maxAgeMs: 0,\n maxProducts: 1,\n tags: ['production', 'team-alpha'],\n timeoutMs: 1000,\n directURL: 'https://example.com',\n );\n\n var_dump($response);\n} catch (APIException $e) {\n echo $e->getMessage();\n}"
- lang: CLI
source: "context-dev ai extract-products \\\n --api-key 'My API Key' \\\n --domain domain \\\n --direct-url https://example.com"
components:
schemas:
KeyMetadata:
type: object
properties:
credits_consumed:
type: integer
description: The number of credits consumed by this request.
credits_remaining:
type: integer
description: The number of credits remaining for your organization after this request.
required:
- credits_consumed
- credits_remaining
description: Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.
ErrorResponse:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- INTERNAL_ERROR
- VALID
- NOT_FOUND
- FORBIDDEN
- USAGE_EXCEEDED
- RATE_LIMITED
- UNAUTHORIZED
- DISABLED
- INSUFFICIENT_PERMISSIONS
- TIMEOUT_EXCEEDS_MAXIMUM
- WEBSITE_ACCESS_ERROR
- EXTERNAL_PROVIDER_ERROR
- INPUT_VALIDATION_ERROR
- FREE_EMAIL_DETECTED
- DISPOSABLE_EMAIL_DETECTED
- REQUEST_TIMEOUT
- UNSUPPORTED_CONTENT
- MONITOR_PAUSED
- MONITOR_LIMIT_EXCEEDED
- SEARCH_UNAVAILABLE
description: Error code indicating the type of error
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
TimeoutMS:
type: integer
minimum: 1000
maximum: 300000
description: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
RequestTags:
type: array
items:
type: string
minLength: 1
maxLength: 50
maxItems: 20
description: Optional caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.
example:
- production
- team-alpha
headers:
RateLimitRemaining:
description: Requests remaining in the current fixed one-minute window. Returned when the authenticated API key has a per-minute rate limit.
schema:
type: integer
minimum: 0
RateLimitReset:
description: Unix timestamp in seconds when the current rate-limit window resets. Returned when the authenticated API key has a per-minute rate limit.
schema:
type: integer
RateLimitLimit:
description: Maximum requests allowed in the current fixed one-minute window. Returned when the authenticated API key has a per-minute rate limit.
schema:
type: integer
minimum: 1
responses:
RateLimited:
description: Rate limit exceeded
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
Retry-After:
description: Seconds until the per-minute rate limit window resets
schema:
type: integer
minimum: 1
maximum: 60
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: Error message
error_code:
type: string
enum:
- RATE_LIMITED
description: Error code indicating the rate limit was exceeded
key_metadata:
$ref: '#/components/schemas/KeyMetadata'
required:
- message
- error_code
parameters:
RequestTags:
name: tags
in: query
required: false
style: form
explode: false
schema:
$ref: '#/components/schemas/RequestTags'
description: Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.
example: production,team-alpha
securitySchemes:
bearerAuth:
type: http
scheme: bearer