{"openapi":"3.1.0","info":{"title":"Context API","description":"API for retrieving context data from any website","version":"1.0.0"},"servers":[{"url":"https://api.context.dev/v1"}],"tags":[{"name":"Batch","description":"Scrape many pages or crawl a site asynchronously."},{"name":"Monitors","description":"Monitor pages, sitemaps, and extracted website data for exact or semantic changes. Webhook payloads are documented by the MonitorsChangeDetectedWebhookPayload and MonitorsRunCompletedWebhookPayload schemas."},{"name":"WebDBs","description":"Create structured tables from web pages and keep them up to date."},{"name":"News","description":"Search live first-party RSS and free historical news data by company identity."}],"components":{"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"}},"headers":{"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}},"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"}}},"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"]}}}},"MonitorsBadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}}},"MonitorsUnauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}}},"MonitorsNotFound":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}}},"MonitorsLimitExceeded":{"description":"Monitor limit for the account reached (error_code MONITOR_LIMIT_EXCEEDED)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}}},"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}}},"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}}},"NotFound":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer <API_KEY>`, where `<API_KEY>` is your api key."}},"schemas":{"RequestTags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20,"description":"Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.","example":["production","team-alpha"]},"HeaderMap":{"type":"object","additionalProperties":{"type":"string","maxLength":8192,"pattern":"^[^\\r\\n]*$"},"description":"The HeaderMap schema."},"BrowserCountryCode":{"type":"string","enum":["ad","ae","af","ag","ai","al","am","ao","ar","at","au","aw","az","ba","bb","bd","be","bf","bg","bh","bi","bj","bm","bn","bo","bq","br","bs","bw","by","bz","ca","cd","cf","cg","ch","ci","cl","cm","cn","co","cr","cv","cw","cy","cz","de","dj","dk","dm","do","dz","ec","ee","eg","es","et","fi","fj","fr","ga","gb","gd","ge","gf","gg","gh","gm","gn","gp","gq","gr","gt","gu","gw","gy","hk","hn","hr","ht","hu","id","ie","il","im","in","iq","ir","is","it","je","jm","jo","jp","ke","kg","kh","kn","kr","kw","ky","kz","la","lb","lc","lk","lr","ls","lt","lu","lv","ly","ma","mc","md","me","mf","mg","mk","ml","mm","mn","mo","mq","mr","mt","mu","mv","mw","mx","my","mz","na","nc","ne","ng","ni","nl","no","np","nz","om","pa","pe","pf","pg","ph","pk","pl","pr","ps","pt","py","qa","re","ro","rs","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sr","ss","st","sv","sx","sy","sz","tc","td","tg","th","tj","tl","tm","tn","tr","tt","tw","tz","ua","ug","us","uy","uz","vc","ve","vg","vi","vn","ye","yt","za","zm","zw"],"example":"de","description":"Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2)."},"PageMetadataValue":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The PageMetadataValue schema."},"PageMetadataAlternate":{"type":"object","properties":{"href":{"type":"string","description":"Resolved alternate URL."},"hreflang":{"type":"string","description":"Language or locale for the alternate URL, when present."},"type":{"type":"string","description":"Alternate resource MIME type, when present."},"title":{"type":"string","description":"Alternate resource title, when present."}},"required":["href"],"additionalProperties":false,"description":"The PageMetadataAlternate schema."},"PageMetadataHeading":{"type":"object","properties":{"level":{"type":"integer","minimum":1,"maximum":6,"description":"Heading level, 1–6 (from h1–h6)."},"text":{"type":"string","description":"Heading text with whitespace collapsed, truncated to 1000 characters."}},"required":["level","text"],"additionalProperties":false,"description":"The PageMetadataHeading schema."},"PageMetadata":{"type":"object","properties":{"sourceUrl":{"type":"string","description":"Original URL requested by the caller."},"finalUrl":{"type":"string","description":"Final URL scraped after redirects or scraper fallback, when known. Falls back to sourceUrl when unavailable."},"title":{"type":"string","description":"Best title extracted from the page."},"description":{"type":"string","description":"Best description extracted from standard, Open Graph, or Twitter metadata."},"language":{"type":"string","description":"Language extracted from html lang or language meta tags."},"keywords":{"type":"array","items":{"type":"string"},"description":"Keywords extracted from the page's keywords meta tag."},"canonicalUrl":{"type":"string","description":"Resolved canonical URL, when present."},"author":{"type":"string","description":"Author metadata, when present."},"siteName":{"type":"string","description":"Site or application name from page metadata."},"image":{"type":"string","description":"Primary resolved preview image from Open Graph, Twitter, or image metadata."},"favicon":{"type":"string","description":"Resolved favicon URL, when present."},"publishedTime":{"type":"string","description":"Published timestamp/date from page metadata, when present."},"modifiedTime":{"type":"string","description":"Modified timestamp/date from page metadata, when present."},"robots":{"type":"string","description":"Robots meta directive, when present."},"openGraph":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PageMetadataValue"},"description":"Open Graph metadata with the og: prefix removed and keys camel-cased."},"twitter":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PageMetadataValue"},"description":"Twitter card metadata with the twitter: prefix removed and keys camel-cased."},"alternates":{"type":"array","items":{"$ref":"#/components/schemas/PageMetadataAlternate"},"description":"Resolved alternate links from link rel=alternate tags."},"headings":{"type":"array","items":{"$ref":"#/components/schemas/PageMetadataHeading"},"description":"Page headings (h1–h6) in document order, extracted from the unfiltered document. Capped at the first 500 headings. Omitted when the page has none."},"jsonLd":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"JSON-LD structured data blocks parsed from the page."},"additionalMeta":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PageMetadataValue"},"description":"Additional non-social meta tags not promoted to top-level metadata fields."}},"required":["sourceUrl","finalUrl"],"description":"Metadata extracted from the scraped page HTML."},"Industry":{"type":"string","enum":["Aerospace & Defense","Technology","Finance","Healthcare","Retail & E-commerce","Entertainment","Education","Government & Nonprofit","Industrial & Energy","Automotive & Transportation","Lifestyle & Leisure","Luxury & Fashion","News & Media","Sports","Real Estate & PropTech","Legal & Compliance","Telecommunications","Agriculture & Food","Professional Services & Agencies","Chemicals & Materials","Logistics & Supply Chain","Hospitality & Tourism","Construction & Built Environment","Consumer Packaged Goods (CPG)"],"description":"Industry classification enum"},"Subindustry":{"type":"string","enum":["Defense Systems & Military Hardware","Aerospace Manufacturing","Avionics & Navigation Technology","Subsea & Naval Defense Systems","Space & Satellite Technology","Defense IT & Systems Integration","Software (B2B)","Software (B2C)","Cloud Infrastructure & DevOps","Cybersecurity","Artificial Intelligence & Machine Learning","Data Infrastructure & Analytics","Hardware & Semiconductors","Fintech Infrastructure","eCommerce & Marketplace Platforms","Developer Tools & APIs","Web3 & Blockchain","XR & Spatial Computing","Banking & Lending","Investment Management & WealthTech","Insurance & InsurTech","Payments & Money Movement","Accounting, Tax & Financial Planning Tools","Capital Markets & Trading Platforms","Financial Infrastructure & APIs","Credit Scoring & Risk Management","Cryptocurrency & Digital Assets","BNPL & Alternative Financing","Healthcare Providers & Services","Pharmaceuticals & Drug Development","Medical Devices & Diagnostics","Biotechnology & Genomics","Digital Health & Telemedicine","Health Insurance & Benefits Tech","Clinical Trials & Research Platforms","Mental Health & Wellness","Healthcare IT & EHR Systems","Consumer Health & Wellness Products","Online Marketplaces","Direct-to-Consumer (DTC) Brands","Retail Tech & Point-of-Sale Systems","Omnichannel & In-Store Retail","E-commerce Enablement & Infrastructure","Subscription & Membership Commerce","Social Commerce & Influencer Platforms","Fashion & Apparel Retail","Food, Beverage & Grocery E-commerce","Streaming Platforms (Video, Music, Audio)","Gaming & Interactive Entertainment","Creator Economy & Influencer Platforms","Film, TV & Production Studios","Events, Venues & Live Entertainment","Virtual Worlds & Metaverse Experiences","K-12 Education Platforms & Tools","Higher Education & University Tech","Online Learning & MOOCs","Test Prep & Certification","Corporate Training & Upskilling","Tutoring & Supplemental Learning","Education Management Systems (LMS/SIS)","Language Learning","Creator-Led & Cohort-Based Courses","Special Education & Accessibility Tools","Government Technology & Digital Services","Civic Engagement & Policy Platforms","International Development & Humanitarian Aid","Philanthropy & Grantmaking","Nonprofit Operations & Fundraising Tools","Public Health & Social Services","Education & Youth Development Programs","Environmental & Climate Action Organizations","Legal Aid & Social Justice Advocacy","Municipal & Infrastructure Services","Manufacturing & Industrial Automation","Energy Production (Oil, Gas, Nuclear)","Renewable Energy & Cleantech","Utilities & Grid Infrastructure","Industrial IoT & Monitoring Systems","Construction & Heavy Equipment","Mining & Natural Resources","Environmental Engineering & Sustainability","Energy Storage & Battery Technology","Automotive OEMs & Vehicle Manufacturing","Electric Vehicles (EVs) & Charging Infrastructure","Mobility-as-a-Service (MaaS)","Fleet Management","Public Transit & Urban Mobility","Autonomous Vehicles & ADAS","Aftermarket Parts & Services","Telematics & Vehicle Connectivity","Aviation & Aerospace Transport","Maritime Shipping","Fitness & Wellness","Beauty & Personal Care","Home & Living","Dating & Relationships","Hobbies, Crafts & DIY","Outdoor & Recreational Gear","Events, Experiences & Ticketing Platforms","Designer & Luxury Apparel","Accessories, Jewelry & Watches","Footwear & Leather Goods","Beauty, Fragrance & Skincare","Fashion Marketplaces & Retail Platforms","Sustainable & Ethical Fashion","Resale, Vintage & Circular Fashion","Fashion Tech & Virtual Try-Ons","Streetwear & Emerging Luxury","Couture & Made-to-Measure","News Publishing & Journalism","Advertising, Adtech & Media Buying","Digital Media & Content Platforms","Broadcasting (TV & Radio)","Podcasting & Audio Media","News Aggregators & Curation Tools","Independent & Creator-Led Media","Newsletters & Substack-Style Platforms","Political & Investigative Media","Trade & Niche Publications","Media Monitoring & Analytics","Professional Teams & Leagues","Sports Media & Broadcasting","Sports Betting & Fantasy Sports","Fitness & Athletic Training Platforms","Sportswear & Equipment","Esports & Competitive Gaming","Sports Venues & Event Management","Athlete Management & Talent Agencies","Sports Tech & Performance Analytics","Youth, Amateur & Collegiate Sports","Real Estate Marketplaces","Property Management Software","Rental Platforms","Mortgage & Lending Tech","Real Estate Investment Platforms","Law Firms & Legal Services","Legal Tech & Automation","Regulatory Compliance","E-Discovery & Litigation Tools","Contract Management","Governance, Risk & Compliance (GRC)","IP & Trademark Management","Legal Research & Intelligence","Compliance Training & Certification","Whistleblower & Ethics Reporting","Mobile & Wireless Networks (3G/4G/5G)","Broadband & Fiber Internet","Satellite & Space-Based Communications","Network Equipment & Infrastructure","Telecom Billing & OSS/BSS Systems","VoIP & Unified Communications","Internet Service Providers (ISPs)","Edge Computing & Network Virtualization","IoT Connectivity Platforms","Precision Agriculture & AgTech","Crop & Livestock Production","Food & Beverage Manufacturing & Processing","Food Distribution","Restaurants & Food Service","Agricultural Inputs & Equipment","Sustainable & Regenerative Agriculture","Seafood & Aquaculture","Management Consulting","Marketing & Advertising Agencies","Design, Branding & Creative Studios","IT Services & Managed Services","Staffing, Recruiting & Talent","Accounting & Tax Firms","Public Relations & Communications","Business Process Outsourcing (BPO)","Professional Training & Coaching","Specialty Chemicals","Commodity & Petrochemicals","Polymers, Plastics & Rubber","Coatings, Adhesives & Sealants","Industrial Gases","Advanced Materials & Composites","Battery Materials & Energy Storage","Electronic Materials & Semiconductor Chemicals","Agrochemicals & Fertilizers","Freight & Transportation Tech","Last-Mile Delivery","Warehouse Automation","Supply Chain Visibility Platforms","Logistics Marketplaces","Shipping & Freight Forwarding","Cold Chain Logistics","Reverse Logistics & Returns","Cross-Border Trade Tech","Transportation Management Systems (TMS)","Hotels & Accommodation","Vacation Rentals & Short-Term Stays","Restaurant Tech & Management","Travel Booking Platforms","Tourism Experiences & Activities","Cruise Lines & Marine Tourism","Hospitality Management Systems","Event & Venue Management","Corporate Travel Management","Travel Insurance & Protection","Construction Management Software","BIM/CAD & Design Tools","Construction Marketplaces","Equipment Rental & Management","Building Materials & Procurement","Construction Workforce Management","Project Estimation & Bidding","Modular & Prefab Construction","Construction Safety & Compliance","Smart Building Technology","Food & Beverage CPG","Home & Personal Care CPG","CPG Analytics & Insights","Direct-to-Consumer CPG Brands","CPG Supply Chain & Distribution","Private Label Manufacturing","CPG Retail Intelligence","Sustainable CPG & Packaging","Beauty & Cosmetics CPG","Health & Wellness CPG"],"description":"Subindustry classification enum"},"SupportedLanguage":{"type":"string","enum":["afrikaans","albanian","amharic","arabic","armenian","assamese","aymara","azeri","basque","belarusian","bengali","bosnian","bulgarian","burmese","cantonese","catalan","cebuano","chinese","corsican","croatian","czech","danish","dutch","english","esperanto","estonian","farsi","fijian","finnish","french","galician","georgian","german","greek","guarani","gujarati","haitian-creole","hausa","hawaiian","hebrew","hindi","hmong","hungarian","icelandic","igbo","indonesian","irish","italian","japanese","javanese","kannada","kazakh","khmer","kinyarwanda","korean","kurdish","kyrgyz","lao","latin","latvian","lingala","lithuanian","luxembourgish","macedonian","malagasy","malay","malayalam","maltese","maori","marathi","mongolian","nepali","norwegian","odia","oromo","pashto","pidgin","polish","portuguese","punjabi","quechua","romanian","russian","samoan","scottish-gaelic","serbian","sesotho","shona","sindhi","sinhala","slovak","slovene","somali","spanish","sundanese","swahili","swedish","tagalog","tajik","tamil","tatar","telugu","thai","tibetan","tigrinya","tongan","tswana","turkish","turkmen","ukrainian","urdu","uyghur","uzbek","vietnamese","welsh","wolof","xhosa","yiddish","yoruba","zulu"],"description":"Language to force for the retrieved brand data."},"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."},"BrandResponse":{"type":"object","properties":{"status":{"type":"string","description":"Status of the response, e.g., 'ok'"},"brand":{"type":"object","properties":{"domain":{"type":"string","description":"The domain name of the brand"},"title":{"type":"string","description":"The title or name of the brand"},"description":{"type":"string","description":"A brief description of the brand"},"slogan":{"type":"string","description":"The brand's slogan"},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","description":"Color in hexadecimal format"},"name":{"type":"string","description":"Name of the color"},"source":{"type":"string","enum":["site","logo"],"description":"Where the color was observed: 'site' colors come from the website's own theme signals (rendered page colors, manifest, theme-color meta), 'logo' colors from logo image pixels."}}},"description":"An array of brand colors"},"logos":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"CDN hosted url of the logo (ready for display)"},"mode":{"type":"string","enum":["light","dark","has_opaque_background"],"description":"Indicates when this logo is best used: 'light' = best for light mode, 'dark' = best for dark mode, 'has_opaque_background' = can be used for either as image has its own background"},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","description":"Color in hexadecimal format"},"name":{"type":"string","description":"Name of the color"}}},"description":"Array of colors in the logo"},"resolution":{"type":"object","properties":{"width":{"type":"integer","description":"Width of the image in pixels"},"height":{"type":"integer","description":"Height of the image in pixels"},"aspect_ratio":{"type":"number","description":"Aspect ratio of the image (width/height)"}},"description":"Resolution of the logo image"},"type":{"type":"string","enum":["icon","logo"],"description":"Type of the logo based on resolution (e.g., 'icon', 'logo')"}}},"description":"An array of logos associated with the brand. When a similarly shaped SVG variant exists, it is returned ahead of its raster equivalent; otherwise relevance order is preserved"},"backdrops":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"URL of the backdrop image"},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","description":"Color in hexadecimal format"},"name":{"type":"string","description":"Name of the color"}}},"description":"Array of colors in the backdrop image"},"resolution":{"type":"object","properties":{"width":{"type":"integer","description":"Width of the image in pixels"},"height":{"type":"integer","description":"Height of the image in pixels"},"aspect_ratio":{"type":"number","description":"Aspect ratio of the image (width/height)"}},"description":"Resolution of the backdrop image"}}},"description":"An array of backdrop images for the brand"},"socials":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["x","facebook","instagram","linkedin","youtube","pinterest","tiktok","dribbble","github","behance","snapchat","whatsapp","telegram","line","discord","twitch","vimeo","imdb","tumblr","flickr","giphy","medium","spotify","soundcloud","tripadvisor","yelp","producthunt","reddit","crunchbase","appstore","playstore"],"description":"Type of social media platform"},"url":{"type":"string","description":"URL of the social media page"}}},"description":"An array of social media links for the brand"},"address":{"type":"object","properties":{"street":{"type":"string","description":"Street address"},"city":{"type":"string","description":"City name"},"country":{"type":"string","description":"Country name"},"country_code":{"type":"string","description":"Country code"},"state_province":{"type":"string","description":"State or province name"},"state_code":{"type":"string","description":"State or province code"},"postal_code":{"type":"string","description":"Postal or ZIP code"}},"description":"Physical address of the brand"},"stock":{"type":"object","properties":{"ticker":{"type":"string","description":"Stock ticker symbol"},"exchange":{"type":"string","description":"Stock exchange name"}},"description":"Stock market information for this brand (will be null if not a publicly traded company)"},"employees":{"type":"object","properties":{"range":{"type":"string","enum":["1 to 10","11 to 50","51 to 200","201 to 500","501 to 1000","1001 to 5000","5001 to 10000","10001+"],"description":"Employee count range for the brand (e.g. '11 to 50')"},"exact":{"type":"integer","description":"Exact employee count when a precise headcount is known"}},"description":"Employee headcount information for the brand (will be null if unknown)"},"is_nsfw":{"type":"boolean","description":"Indicates whether the brand content is not safe for work (NSFW)"},"email":{"type":"string","description":"Company email address"},"phone":{"type":"string","description":"Company phone number"},"industries":{"type":"object","properties":{"eic":{"type":"array","items":{"type":"object","properties":{"industry":{"$ref":"#/components/schemas/Industry"},"subindustry":{"$ref":"#/components/schemas/Subindustry"}},"required":["industry","subindustry"]},"description":"Easy Industry Classification - array of industry and subindustry pairs"}},"description":"Industry classification information for the brand"},"links":{"type":"object","properties":{"careers":{"type":["string","null"],"description":"URL to the brand's careers or job opportunities page"},"privacy":{"type":["string","null"],"description":"URL to the brand's privacy policy page"},"terms":{"type":["string","null"],"description":"URL to the brand's terms of service or terms and conditions page"},"contact":{"type":["string","null"],"description":"URL to the brand's contact or contact us page"},"blog":{"type":["string","null"],"description":"URL to the brand's blog or news page"},"pricing":{"type":["string","null"],"description":"URL to the brand's pricing or plans page"}},"description":"Important website links for the brand"},"primary_language":{"anyOf":[{"allOf":[{"$ref":"#/components/schemas/SupportedLanguage"}]},{"type":"null"}],"description":"The primary language of the brand's website content. Detected from the HTML lang tag, page content analysis, or social media descriptions."}},"description":"Detailed brand information"},"code":{"type":"integer","description":"HTTP status code"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"description":"The BrandResponse schema."},"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","PAID_PLAN_REQUIRED","INSUFFICIENT_PERMISSIONS","TIMEOUT_EXCEEDS_MAXIMUM","WEBSITE_ACCESS_ERROR","WEBSITE_BLOCKED","WEBSITE_NOT_FOUND","PDF_SKIPPED","PDF_IMAGES_ONLY","EXTERNAL_PROVIDER_ERROR","INPUT_VALIDATION_ERROR","ZDR_NOT_SUPPORTED","ZDR_NOT_ENABLED","FREE_EMAIL_DETECTED","DISPOSABLE_EMAIL_DETECTED","REQUEST_TIMEOUT","COLD_DOMAIN_TIMEOUT_TOO_LOW","UNSUPPORTED_CONTENT","CONTENT_TOO_LARGE","MONITOR_PAUSED","MONITOR_NO_WEBHOOK","COLLECTION_PAUSED","MONITOR_LIMIT_EXCEEDED","SEARCH_UNAVAILABLE","BATCH_LIMIT_EXCEEDED","BATCH_NOT_CANCELLABLE","BATCH_NOT_COMPLETED","IDEMPOTENCY_KEY_CONFLICT"],"description":"Error code indicating the type of error"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"description":"The ErrorResponse schema."},"SimplifiedBrandResponse":{"type":"object","properties":{"status":{"type":"string","description":"Status of the response, e.g., 'ok'"},"brand":{"type":"object","properties":{"domain":{"type":"string","description":"The domain name of the brand"},"title":{"type":"string","description":"The title or name of the brand"},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","description":"Color in hexadecimal format"},"name":{"type":"string","description":"Name of the color"},"source":{"type":"string","enum":["site","logo"],"description":"Where the color was observed: 'site' colors come from the website's own theme signals (rendered page colors, manifest, theme-color meta), 'logo' colors from logo image pixels."}}},"description":"An array of brand colors"},"logos":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"CDN hosted url of the logo (ready for display)"},"mode":{"type":"string","enum":["light","dark","has_opaque_background"],"description":"Indicates when this logo is best used: 'light' = best for light mode, 'dark' = best for dark mode, 'has_opaque_background' = can be used for either as image has its own background"},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","description":"Color in hexadecimal format"},"name":{"type":"string","description":"Name of the color"}}},"description":"Array of colors in the logo"},"resolution":{"type":"object","properties":{"width":{"type":"integer","description":"Width of the image in pixels"},"height":{"type":"integer","description":"Height of the image in pixels"},"aspect_ratio":{"type":"number","description":"Aspect ratio of the image (width/height)"}},"description":"Resolution of the logo image"},"type":{"type":"string","enum":["icon","logo"],"description":"Type of the logo based on resolution (e.g., 'icon', 'logo')"}}},"description":"An array of logos associated with the brand"},"backdrops":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"URL of the backdrop image"},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","description":"Color in hexadecimal format"},"name":{"type":"string","description":"Name of the color"}}},"description":"Array of colors in the backdrop image"},"resolution":{"type":"object","properties":{"width":{"type":"integer","description":"Width of the image in pixels"},"height":{"type":"integer","description":"Height of the image in pixels"},"aspect_ratio":{"type":"number","description":"Aspect ratio of the image (width/height)"}},"description":"Resolution of the backdrop image"}}},"description":"An array of backdrop images for the brand"}},"description":"Simplified brand information"},"code":{"type":"integer","description":"HTTP status code of the response"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"description":"The SimplifiedBrandResponse schema."},"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)."},"LenientTimeoutMS":{"type":"integer","minimum":1,"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)."},"UtilityPrefetchDomainIdentifier":{"type":"object","properties":{"domain":{"type":"string","minLength":3,"description":"Domain name to prefetch data for"}},"required":["domain"],"additionalProperties":false,"title":"By domain","description":"Prefetch by domain."},"UtilityPrefetchEmailIdentifier":{"type":"object","properties":{"email":{"type":"string","minLength":1,"format":"email","description":"Email address to prefetch data for. The domain will be extracted from the email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email addresses are not allowed."}},"required":["email"],"additionalProperties":false,"title":"By email","description":"Prefetch by email. The domain will be extracted and validated."},"UtilityPrefetchIdentifier":{"oneOf":[{"$ref":"#/components/schemas/UtilityPrefetchDomainIdentifier"},{"$ref":"#/components/schemas/UtilityPrefetchEmailIdentifier"}],"description":"Identifier of the target to prefetch. Provide exactly one of domain or email."},"PersonSource":{"type":"object","properties":{"provider":{"type":"string","enum":["linkedin","cv","manual","github","other"],"description":"Source category for this fact."},"sourceUrl":{"type":"string","format":"uri","description":"URL where this fact was found."},"importedAt":{"type":"string","format":"date-time","description":"Time this source was added."}},"required":["provider","importedAt"],"additionalProperties":false,"description":"The PersonSource schema."},"PersonDate":{"type":"object","properties":{"year":{"type":"integer","description":"Year value."},"month":{"type":"integer","minimum":1,"maximum":12,"description":"Month value, when known."},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day value, when known."}},"required":["year"],"additionalProperties":false,"description":"The PersonDate schema."},"PersonDateRange":{"type":"object","properties":{"startDate":{"allOf":[{"$ref":"#/components/schemas/PersonDate"}],"description":"Start date, when known."},"endDate":{"allOf":[{"$ref":"#/components/schemas/PersonDate"}],"description":"End date, when known."},"isCurrent":{"type":"boolean","description":"Whether the entry is current."}},"additionalProperties":false,"description":"The PersonDateRange schema."},"PersonOrganization":{"type":"object","properties":{"display":{"type":"string","description":"Display name."},"normalized":{"type":"string","description":"Standardized name, when available."},"linkedinUrl":{"type":"string","format":"uri","description":"The organization's LinkedIn page URL."},"websiteUrl":{"type":"string","format":"uri","description":"The organization's website URL."},"logoUrl":{"type":"string","format":"uri","description":"The organization's logo, hosted on the Context.dev CDN."},"employeeCount":{"type":"integer","description":"Employee count reported on the LinkedIn page."},"employeeCountRange":{"type":"string","description":"Employee count range reported on the LinkedIn page (e.g. \"51-200\")."},"followerCount":{"type":"integer","description":"Follower count reported on the LinkedIn page."},"headquarters":{"type":"string","description":"Headquarters location (e.g. \"San Francisco, California, United States\")."},"industries":{"type":"array","items":{"type":"object","properties":{"industry":{"$ref":"#/components/schemas/Industry"},"subindustry":{"$ref":"#/components/schemas/Subindustry"}},"required":["industry","subindustry"],"additionalProperties":false},"description":"Context.dev industry classification - array of industry and subindustry pairs."}},"required":["display"],"additionalProperties":false,"description":"The PersonOrganization schema."},"PersonProfile":{"type":"object","properties":{"fullName":{"type":"string","description":"Person's full name."},"headline":{"type":"string","description":"Short professional headline."},"location":{"type":"string","description":"Person's listed location."},"summary":{"type":"string","description":"Brief profile summary."},"profilePictureUrl":{"type":"string","format":"uri","description":"Profile image URL."}},"additionalProperties":false,"description":"The PersonProfile schema."},"PersonEducation":{"type":"object","properties":{"institution":{"allOf":[{"$ref":"#/components/schemas/PersonOrganization"}],"description":"School or institution, including LinkedIn-derived organization data when available."},"qualification":{"type":"string","description":"Degree, certificate, or credential."},"fieldOfStudy":{"type":"string","description":"Area of study."},"description":{"type":"string","description":"Additional education details."},"dates":{"allOf":[{"$ref":"#/components/schemas/PersonDateRange"}],"description":"Education dates."}},"additionalProperties":false,"required":["institution"],"description":"The PersonEducation schema."},"PersonExperience":{"type":"object","properties":{"company":{"allOf":[{"$ref":"#/components/schemas/PersonOrganization"}],"description":"Company or organization, including LinkedIn-derived organization data when available."},"title":{"type":"string","description":"Role or job title."},"description":{"type":"string","description":"Role description."},"dates":{"allOf":[{"$ref":"#/components/schemas/PersonDateRange"}],"description":"Role dates."}},"required":["company","title"],"additionalProperties":false,"description":"The PersonExperience schema."},"PersonSkill":{"type":"object","properties":{"name":{"type":"string","description":"Skill name."},"normalized":{"type":"string","description":"Standardized skill name, when available."},"proficiency":{"type":"string","description":"Skill proficiency, when available."}},"required":["name"],"additionalProperties":false,"description":"The PersonSkill schema."},"Person":{"type":"object","properties":{"profile":{"allOf":[{"$ref":"#/components/schemas/PersonProfile"}],"description":"Core profile details."},"education":{"type":"array","items":{"$ref":"#/components/schemas/PersonEducation"},"description":"Education history."},"experience":{"type":"array","items":{"$ref":"#/components/schemas/PersonExperience"},"description":"Work history."},"skills":{"type":"array","items":{"$ref":"#/components/schemas/PersonSkill"},"description":"Listed skills."}},"required":["profile","education","experience","skills"],"additionalProperties":false,"description":"The Person schema."},"BrandRetrieveByDomainRequest":{"type":"object","properties":{"force_language":{"allOf":[{"$ref":"#/components/schemas/SupportedLanguage"},{"type":["string","null"]}]},"maxSpeed":{"type":"boolean","description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data."},"maxAgeMs":{"type":"integer","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."},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"type":{"type":"string","enum":["by_domain"],"description":"Discriminator for domain-based brand retrieval."},"domain":{"type":"string","minLength":3,"description":"Domain name to retrieve brand data for (e.g., 'stripe.com')."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["type","domain"],"additionalProperties":false,"title":"By domain","description":"Retrieve brand data by domain. Cannot be combined with name, email, or ticker."},"BrandRetrieveByNameRequest":{"type":"object","properties":{"force_language":{"allOf":[{"$ref":"#/components/schemas/SupportedLanguage"},{"type":["string","null"]}]},"maxSpeed":{"type":"boolean","description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data."},"maxAgeMs":{"type":"integer","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."},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"type":{"type":"string","enum":["by_name"],"description":"Discriminator for name-based brand retrieval."},"name":{"type":"string","minLength":3,"maxLength":30,"description":"Company name to retrieve brand data for (e.g., 'Apple Inc')."},"country_gl":{"type":"string","description":"Optional country code hint (GL parameter) to specify the country when looking up by company name."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["type","name"],"additionalProperties":false,"title":"By name","description":"Retrieve brand data by company name. Cannot be combined with domain, email, or ticker."},"BrandRetrieveByEmailRequest":{"type":"object","properties":{"force_language":{"allOf":[{"$ref":"#/components/schemas/SupportedLanguage"},{"type":["string","null"]}]},"maxSpeed":{"type":"boolean","description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data."},"maxAgeMs":{"type":"integer","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."},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"type":{"type":"string","enum":["by_email"],"description":"Discriminator for email-based brand retrieval."},"email":{"type":"string","minLength":1,"format":"email","description":"Email address to retrieve brand data for (e.g., 'jane@stripe.com')."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["type","email"],"additionalProperties":false,"title":"By email","description":"Retrieve brand data by email address. The domain is extracted from the email. Free and disposable email providers are rejected with 422. Cannot be combined with domain, name, or ticker."},"BrandRetrieveByTickerRequest":{"type":"object","properties":{"force_language":{"allOf":[{"$ref":"#/components/schemas/SupportedLanguage"},{"type":["string","null"]}]},"maxSpeed":{"type":"boolean","description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data."},"maxAgeMs":{"type":"integer","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."},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"type":{"type":"string","enum":["by_ticker"],"description":"Discriminator for ticker-based brand retrieval."},"ticker":{"type":"string","minLength":1,"maxLength":15,"pattern":"^[A-Za-z0-9.]+$","description":"Stock ticker symbol to retrieve brand data for (e.g., 'AAPL')."},"ticker_exchange":{"type":"string","description":"Optional stock exchange for the ticker. Defaults to NASDAQ if not specified."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["type","ticker"],"additionalProperties":false,"title":"By stock","description":"Retrieve brand data by stock ticker. Cannot be combined with domain, name, or email."},"BrandRetrieveByDirectUrlRequest":{"type":"object","properties":{"type":{"type":"string","enum":["by_direct_url"],"description":"Discriminator for direct-URL-based brand retrieval."},"direct_url":{"type":"string","format":"uri","description":"Full http(s) URL to fetch brand data from (e.g., 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire internet."},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["type","direct_url"],"additionalProperties":false,"title":"By direct URL","description":"Retrieve brand data by fetching the provided URL directly. Note: if you use this, brand data is fetched only from the provided URL — not from the entire internet — so results are limited to what that single page contains. No domain resolution, database lookup, or cross-source enrichment is performed. Cannot be combined with domain, name, email, or ticker."},"BrandRetrieveFromTransactionRequest":{"type":"object","properties":{"type":{"type":"string","enum":["by_transaction"],"description":"Discriminator for transaction-based brand retrieval."},"transaction_info":{"type":"string","minLength":3,"maxLength":500,"description":"Transaction information to identify the brand."},"force_language":{"allOf":[{"$ref":"#/components/schemas/SupportedLanguage"},{"type":["string","null"]}]},"maxSpeed":{"type":"boolean","description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data."},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"country_gl":{"type":"string","description":"Optional country code hint (GL parameter) to specify the country when identifying a transaction."},"city":{"type":"string","description":"Optional city name to prioritize when searching for the brand."},"mcc":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Optional Merchant Category Code (MCC) to help identify the business category or industry."},"phone":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Optional phone number from the transaction to help verify brand match."},"high_confidence_only":{"type":"boolean","description":"When set to true, the API performs additional verification to ensure the identified brand matches the transaction with high confidence."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["type","transaction_info"],"additionalProperties":false,"title":"By transaction","description":"Identify brand data from a transaction descriptor. Cannot be combined with domain, name, email, or ticker."},"BrandRetrieveRequest":{"oneOf":[{"$ref":"#/components/schemas/BrandRetrieveByDomainRequest"},{"$ref":"#/components/schemas/BrandRetrieveByNameRequest"},{"$ref":"#/components/schemas/BrandRetrieveByEmailRequest"},{"$ref":"#/components/schemas/BrandRetrieveByTickerRequest"},{"$ref":"#/components/schemas/BrandRetrieveByDirectUrlRequest"},{"$ref":"#/components/schemas/BrandRetrieveFromTransactionRequest"}],"discriminator":{"propertyName":"type","mapping":{"by_domain":"#/components/schemas/BrandRetrieveByDomainRequest","by_name":"#/components/schemas/BrandRetrieveByNameRequest","by_email":"#/components/schemas/BrandRetrieveByEmailRequest","by_ticker":"#/components/schemas/BrandRetrieveByTickerRequest","by_direct_url":"#/components/schemas/BrandRetrieveByDirectUrlRequest","by_transaction":"#/components/schemas/BrandRetrieveFromTransactionRequest"}},"description":"Exactly one lookup type must be provided."},"PersonEnrichmentRequest":{"type":"object","properties":{"social_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":20},"name":{"type":"object","properties":{"first":{"type":"string","minLength":1,"maxLength":100},"last":{"type":"string","minLength":1,"maxLength":100}},"additionalProperties":false},"email":{"type":"string","maxLength":320,"format":"email"},"company":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","minLength":1,"maxLength":253}},"additionalProperties":false},"education":{"type":"array","items":{"type":"object","properties":{"institution":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","minLength":1,"maxLength":253}},"additionalProperties":false},"degree":{"type":"string","minLength":1,"maxLength":200},"field_of_study":{"type":"string","minLength":1,"maxLength":200},"graduation_year":{"type":"integer","minimum":1900,"maximum":2200}},"additionalProperties":false},"minItems":1,"maxItems":10},"location":{"type":"object","properties":{"city":{"type":"string","minLength":1,"maxLength":200},"region":{"type":"string","minLength":1,"maxLength":200},"country":{"type":"string","minLength":1,"maxLength":200}},"additionalProperties":false},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"tags":{"$ref":"#/components/schemas/RequestTags"}},"additionalProperties":false,"description":"Identity clues for one person. Provide a person email, a person-profile social URL, or both first and last name with company, education, or location. All supplied clues are considered together."},"PersonEnrichmentCandidateMatch":{"type":"object","properties":{"status":{"type":"string","enum":["candidate"]},"score":{"type":"integer","minimum":0,"maximum":100},"person":{"type":"object","properties":{"name":{"type":"object","properties":{"full":{"type":"string"},"first":{"type":"string"},"last":{"type":"string"}},"additionalProperties":false},"email":{"type":"string","format":"email"},"avatar_url":{"type":"string","pattern":"^https:\\/\\/media\\.brand\\.dev\\/pfp\\/[0-9a-f-]{36}$"},"bio":{"type":"string"},"location":{"type":"object","properties":{"display":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"country":{"type":"string"},"country_code":{"type":"string"}},"additionalProperties":false},"social_urls":{"type":"array","items":{"type":"string","format":"uri"}},"website_urls":{"type":"array","items":{"type":"string","format":"uri"}},"current_role":{"type":"object","properties":{"title":{"type":"string"},"organization":{"type":"object","properties":{"name":{"type":"string"},"domain":{"type":"string"}},"required":["name"],"additionalProperties":false},"location":{"type":"string"},"description":{"type":"string"},"start_date":{"type":"object","properties":{"year":{"type":"integer"},"month":{"type":"integer","minimum":1,"maximum":12},"day":{"type":"integer","minimum":1,"maximum":31}},"required":["year"],"additionalProperties":false},"end_date":{"type":"object","properties":{"year":{"type":"integer"},"month":{"type":"integer","minimum":1,"maximum":12},"day":{"type":"integer","minimum":1,"maximum":31}},"required":["year"],"additionalProperties":false},"is_current":{"type":"boolean"}},"required":["title","organization"],"additionalProperties":false},"current_role_status":{"type":"string","enum":["present","none","unknown"],"description":"Whether the person's current role is known. `present` — current_role is populated. `none` — the work history explicitly shows every role has ended. `unknown` — our data sources could not confirm either way; treat a missing current_role as unverified rather than vacant."},"experience":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"organization":{"type":"object","properties":{"name":{"type":"string"},"domain":{"type":"string"}},"required":["name"],"additionalProperties":false},"location":{"type":"string"},"description":{"type":"string"},"start_date":{"type":"object","properties":{"year":{"type":"integer"},"month":{"type":"integer","minimum":1,"maximum":12},"day":{"type":"integer","minimum":1,"maximum":31}},"required":["year"],"additionalProperties":false},"end_date":{"type":"object","properties":{"year":{"type":"integer"},"month":{"type":"integer","minimum":1,"maximum":12},"day":{"type":"integer","minimum":1,"maximum":31}},"required":["year"],"additionalProperties":false},"is_current":{"type":"boolean"}},"required":["title","organization"],"additionalProperties":false}},"education":{"type":"array","items":{"type":"object","properties":{"institution":{"type":"object","properties":{"name":{"type":"string"},"domain":{"type":"string"}},"required":["name"],"additionalProperties":false},"degree":{"type":"string"},"field_of_study":{"type":"string"},"description":{"type":"string"},"start_date":{"type":"object","properties":{"year":{"type":"integer"},"month":{"type":"integer","minimum":1,"maximum":12},"day":{"type":"integer","minimum":1,"maximum":31}},"required":["year"],"additionalProperties":false},"end_date":{"type":"object","properties":{"year":{"type":"integer"},"month":{"type":"integer","minimum":1,"maximum":12},"day":{"type":"integer","minimum":1,"maximum":31}},"required":["year"],"additionalProperties":false}},"required":["institution"],"additionalProperties":false}},"skills":{"type":"array","items":{"type":"string"}},"last_updated":{"type":"string","description":"When the underlying profile data last changed in our data sources (ISO 8601). Omitted when unknown."},"checked_at":{"type":"string","description":"When we last refreshed this profile from our data sources (ISO 8601)."}},"required":["social_urls","website_urls","current_role_status","experience","education","skills"],"additionalProperties":false}},"required":["status","score","person"],"additionalProperties":false,"title":"Candidate match","description":"The highest-scoring person candidate."},"PersonEnrichmentNotFoundMatch":{"type":"object","properties":{"status":{"type":"string","enum":["not_found"]},"score":{"type":"null"},"person":{"type":"null"}},"required":["status","score","person"],"additionalProperties":false,"title":"No match","description":"No usable person candidate was found."},"PersonEnrichmentMatch":{"oneOf":[{"$ref":"#/components/schemas/PersonEnrichmentCandidateMatch"},{"$ref":"#/components/schemas/PersonEnrichmentNotFoundMatch"}],"discriminator":{"propertyName":"status","mapping":{"candidate":"#/components/schemas/PersonEnrichmentCandidateMatch","not_found":"#/components/schemas/PersonEnrichmentNotFoundMatch"}},"description":"The PersonEnrichmentMatch schema."},"PersonEnrichmentResponse":{"type":"object","properties":{"match":{"$ref":"#/components/schemas/PersonEnrichmentMatch"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["match"],"additionalProperties":false,"description":"The PersonEnrichmentResponse schema."},"PersonRetrieveRequest":{"type":"object","properties":{"identifiers":{"type":"object","properties":{"linkedinUrl":{"type":"string","format":"uri","description":"LinkedIn profile URL, e.g. https://www.linkedin.com/in/yahia-bakour/."}},"additionalProperties":false,"description":"Known identifiers for the person. At least one identifier is required."},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["identifiers"],"additionalProperties":false,"description":"The PersonRetrieveRequest schema."},"PersonRetrieveResponse":{"type":"object","properties":{"status":{"type":"string","enum":["ok"],"description":"Response status."},"code":{"type":"integer","enum":[200],"description":"HTTP status code."},"person":{"allOf":[{"$ref":"#/components/schemas/Person"}],"description":"Retrieved person profile."},"metadata":{"type":"object","properties":{"identifiers":{"type":"object","properties":{"linkedinUrl":{"type":"string","format":"uri","description":"LinkedIn profile URL."}},"additionalProperties":false,"description":"Identifiers returned for the person."},"personalWebsiteUrl":{"type":"string","format":"uri","description":"Personal website URL, when found."},"urlsAnalyzed":{"type":"array","items":{"type":"string","format":"uri"},"description":"URLs reviewed for this profile."},"sourcesAttempted":{"type":"array","items":{"type":"string","enum":["linkedin","cv","manual","github","other"]},"description":"Source categories checked."},"sourcesSucceeded":{"type":"array","items":{"type":"string","enum":["linkedin","cv","manual","github","other"]},"description":"Source categories with data."}},"required":["identifiers","urlsAnalyzed","sourcesAttempted","sourcesSucceeded"],"additionalProperties":false,"description":"Additional response details."},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["status","code","person","metadata"],"additionalProperties":false,"description":"The PersonRetrieveResponse schema."},"MonitorsMode":{"type":"string","enum":["web"],"description":"Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.","title":"Monitor mode"},"MonitorsPageTarget":{"type":"object","properties":{"type":{"type":"string","enum":["page"]},"url":{"type":"string","format":"uri","example":"https://acme.com/pricing"},"instructions":{"type":"string","minLength":1,"maxLength":2000,"description":"Plain-language goal describing which page changes matter. When provided without change_detection, semantic detection is inferred.","example":"Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation."},"normalize_whitespace":{"type":"boolean","default":true,"description":"Normalize whitespace before comparing or analyzing text."}},"required":["type","url"],"additionalProperties":false,"description":"Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.","title":"Page target"},"MonitorsSitemapTarget":{"type":"object","properties":{"type":{"type":"string","enum":["sitemap"]},"url":{"type":"string","format":"uri","description":"Sitemap URL to monitor.","example":"https://acme.com/sitemap.xml"},"include":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":50,"description":"URL path patterns to include (max 50).","example":["/blog/*","/pricing*"]},"exclude":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":50,"description":"URL path patterns to exclude (max 50).","example":["/legal/*","/privacy"]},"max_urls":{"type":"integer","minimum":1,"maximum":10000,"default":5000,"description":"Maximum number of sitemap URLs to track (capped at 10,000)."}},"required":["type","url"],"additionalProperties":false,"description":"Watch a sitemap for URL additions and removals. Crawled URLs are normalized (lowercased host, no trailing slash/fragment) and scoped to the monitored site and its subdomains before comparison. On a detected difference the sitemap is re-fetched within the same run and only URLs both observations agree on are reported, suppressing transient crawl flaps.","title":"Sitemap target"},"MonitorsExtractTarget":{"type":"object","properties":{"type":{"type":"string","enum":["extract"]},"url":{"type":"string","format":"uri","description":"Root URL to extract structured data from.","example":"https://acme.com"},"schema":{"type":"object","additionalProperties":{},"description":"JSON Schema describing the data you care about. It is used three ways: it guides which pages are selected for tracking, it gives the change judge extra context on which changes matter (alongside `instructions`), and it defines the shape of the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most about once a day). It is not a response format for changes: change events and webhook payloads always contain diffs, summaries, and evidence excerpts — never data in this schema's shape. If omitted, a default summary + key-points schema is used.","example":{"type":"object","properties":{"plans":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"price":{"type":"string"}}}}}}},"instructions":{"type":"string","minLength":1,"maxLength":2000,"description":"Natural-language instructions guiding which pages and facts to track and which changes to report.","example":"Extract every pricing plan with its monthly price and included limits."},"max_pages":{"type":"integer","minimum":1,"maximum":50,"default":10,"description":"Maximum number of pages to track."},"max_depth":{"type":"integer","minimum":0,"maximum":10,"description":"Optional maximum link depth from the starting URL (0 = only the starting page)."},"follow_subdomains":{"type":"boolean","default":false}},"required":["type","url","instructions"],"additionalProperties":false,"title":"Extract target","description":"The MonitorsExtractTarget schema."},"MonitorsTarget":{"oneOf":[{"$ref":"#/components/schemas/MonitorsPageTarget"},{"$ref":"#/components/schemas/MonitorsSitemapTarget"},{"allOf":[{"$ref":"#/components/schemas/MonitorsExtractTarget"},{"description":"Watch the monitor-relevant pages of a site for meaningful changes. A crawl guided by `schema`/`instructions` selects up to `max_pages` relevant pages to track; each run re-checks exactly those pages, and confirmed content changes are judged for relevance against the monitor's `instructions` (and `schema`, when provided). The tracked page set is refreshed by a periodic re-discovery crawl."}]}],"discriminator":{"propertyName":"type","mapping":{"page":"#/components/schemas/MonitorsPageTarget","sitemap":"#/components/schemas/MonitorsSitemapTarget","extract":"#/components/schemas/MonitorsExtractTarget"}},"description":"Discriminated union describing what the monitor watches."},"MonitorsExactChangeDetection":{"type":"object","properties":{"type":{"type":"string","enum":["exact"]}},"required":["type"],"additionalProperties":false,"description":"Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.","title":"Exact"},"MonitorsSemanticChangeDetection":{"type":"object","properties":{"type":{"type":"string","enum":["semantic"]},"confidence_threshold":{"type":"number","minimum":0,"maximum":1,"default":0.75}},"required":["type"],"additionalProperties":false,"description":"Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).","title":"Semantic"},"MonitorsChangeDetection":{"oneOf":[{"$ref":"#/components/schemas/MonitorsExactChangeDetection"},{"$ref":"#/components/schemas/MonitorsSemanticChangeDetection"}],"discriminator":{"propertyName":"type","mapping":{"exact":"#/components/schemas/MonitorsExactChangeDetection","semantic":"#/components/schemas/MonitorsSemanticChangeDetection"}},"description":"Discriminated union describing how changes are detected."},"MonitorsScheduleUnit":{"type":"string","enum":["minutes","hours","days"],"example":"hours","description":"The MonitorsScheduleUnit schema."},"MonitorsIntervalSchedule":{"type":"object","properties":{"type":{"type":"string","enum":["interval"]},"frequency":{"type":"integer","minimum":1,"maximum":525600,"description":"Number of units between runs. The resulting interval (frequency × unit) must be at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; maximum 365 when unit is days).","example":6},"unit":{"$ref":"#/components/schemas/MonitorsScheduleUnit"}},"required":["type","frequency","unit"],"additionalProperties":false,"description":"Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.","title":"Interval"},"MonitorsSchedule":{"oneOf":[{"$ref":"#/components/schemas/MonitorsIntervalSchedule"}],"discriminator":{"propertyName":"type","mapping":{"interval":"#/components/schemas/MonitorsIntervalSchedule"}},"description":"Discriminated union describing how the monitor is scheduled. Only `interval` is supported today; `cron` and `exact_time` are reserved for future use."},"MonitorsWebhookConfig":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Webhook URL events are delivered to.","example":"https://example.com/webhook"},"events":{"type":"array","items":{"type":"string","enum":["change.detected","run.completed"]},"minItems":1,"maxItems":2,"uniqueItems":true,"description":"Events delivered to this endpoint. `change.detected` fires only when a run detects a change; `run.completed` fires on every completed run — including runs that detected no change — and embeds the change when one was detected. Defaults to `[\"change.detected\"]` when omitted.","example":["change.detected","run.completed"]},"secret":{"type":"string","readOnly":true,"description":"Signing secret used to verify webhook authenticity. Each delivery includes an `X-Context-Signature: t=<unix>,v1=<hmac>` header, where the HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"` keyed by this secret. Recompute it with a constant-time compare and reject stale timestamps to prevent replay. Generated by the API; cannot be set by clients.","example":"whsec_8f3a…"}},"required":["url"],"additionalProperties":false,"description":"The MonitorsWebhookConfig schema."},"MonitorsNullableWebhookConfig":{"anyOf":[{"allOf":[{"$ref":"#/components/schemas/MonitorsWebhookConfig"}]},{"type":"null"}],"description":"The MonitorsNullableWebhookConfig schema."},"MonitorsCreateMonitorRequest":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/MonitorsMode"},"name":{"type":"string","minLength":1,"maxLength":200,"example":"Acme pricing monitor"},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20,"uniqueItems":true,"description":"User-defined tags for grouping and filtering monitors and their changes. Duplicates are removed.","example":["pricing","competitor"]},"target":{"$ref":"#/components/schemas/MonitorsTarget"},"change_detection":{"$ref":"#/components/schemas/MonitorsChangeDetection"},"schedule":{"$ref":"#/components/schemas/MonitorsSchedule"},"webhook":{"$ref":"#/components/schemas/MonitorsNullableWebhookConfig"}},"required":["name","target"],"additionalProperties":false,"title":"Create monitor request","description":"Creates a web monitor. `mode` is the constant `web`; the behavior is described by `target` (page, sitemap, or extract) and `change_detection` (exact or semantic). Supported combinations: page + exact, page + semantic, sitemap + exact, extract + semantic. `change_detection` is optional; page targets with `instructions` infer semantic detection, while page targets without them infer exact detection. Other targets default to their supported detection type. `schedule` is optional and defaults to once per day."},"MonitorsUpdateMonitorRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"example":"Acme pricing monitor"},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20,"uniqueItems":true,"description":"User-defined tags for grouping and filtering monitors and their changes. Duplicates are removed.","example":["pricing","competitor"]},"status":{"type":"string","enum":["active","paused"]},"target":{"$ref":"#/components/schemas/MonitorsTarget"},"change_detection":{"$ref":"#/components/schemas/MonitorsChangeDetection"},"schedule":{"$ref":"#/components/schemas/MonitorsSchedule"},"webhook":{"$ref":"#/components/schemas/MonitorsNullableWebhookConfig","description":"Set to null to remove the webhook."}},"additionalProperties":false,"description":"Shared monitor update fields. `target` and `change_detection` can be updated, but the final combination must be supported."},"MonitorsMonitorStatus":{"type":"string","enum":["active","paused","failed"],"description":"Monitor lifecycle status. `failed` means the most recent run failed (see the monitor's `last_error`); failed monitors keep running on schedule and flip back to `active` on the next successful run. Monitors are auto-`paused` after repeated consecutive failures or insufficient-credit skips; resume by PATCHing status to `active`."},"MonitorsRunError":{"type":"object","properties":{"code":{"type":"string","example":"fetch_failed"},"message":{"type":"string","example":"The target URL could not be fetched."}},"required":["code","message"],"additionalProperties":false,"description":"The MonitorsRunError schema."},"MonitorsWebhookFailure":{"type":"object","properties":{"consecutive_failures":{"type":"integer","minimum":1,"description":"Number of consecutive delivery attempts that did not succeed.","example":3},"last_status":{"type":"string","enum":["rejected","failed","skipped_unsafe_url"],"description":"Outcome of the most recent failed delivery. rejected means a non-2xx response; failed means no HTTP response was received; skipped_unsafe_url means the URL failed the public-endpoint safety check."},"last_message":{"type":"string","description":"Human-readable description of the most recent failure.","example":"Webhook endpoint returned HTTP 429."},"last_failed_at":{"type":"string","format":"date-time"}},"required":["consecutive_failures","last_status","last_message","last_failed_at"],"additionalProperties":false,"description":"The MonitorsWebhookFailure schema."},"MonitorsPageBaseline":{"type":"object","properties":{"text":{"type":"string","description":"The page's visible text as last observed.","example":"Acme Pricing\nStarter $9/mo…"},"captured_at":{"type":"string","format":"date-time","description":"When this baseline was last captured or replaced."}},"required":["text","captured_at"],"additionalProperties":false,"title":"Page baseline","description":"Current baseline of a `page` monitor: the visible page text as last observed."},"MonitorsSitemapBaseline":{"type":"object","properties":{"urls":{"type":"array","items":{"type":"string"},"description":"The sitemap URLs as last observed (sorted, normalized).","example":["https://acme.com/blog/launch","https://acme.com/pricing"]},"url_count":{"type":"integer","description":"Number of URLs in the baseline.","example":2},"captured_at":{"type":"string","format":"date-time","description":"When this baseline was last captured or replaced."}},"required":["urls","url_count","captured_at"],"additionalProperties":false,"title":"Sitemap baseline","description":"Current baseline of a `sitemap` monitor: the normalized URL set as last observed."},"MonitorsExtractBaseline":{"type":"object","properties":{"data":{"description":"The extracted structured data, matching the monitor's extraction schema (same shape as the /web/extract endpoint's `data`). Refreshed when the monitor re-discovers its page set (at most about once a day); `null` when no extraction has been captured yet.","example":{"plans":[{"name":"Starter","price":"$9/mo"}]}},"urls_analyzed":{"type":"array","items":{"type":"string"},"description":"The page URLs the monitor tracks and analyzes for changes.","example":["https://acme.com/pricing"]},"captured_at":{"type":"string","format":"date-time","description":"When this baseline was last captured or replaced."}},"required":["data","urls_analyzed","captured_at"],"additionalProperties":false,"title":"Extract baseline","description":"Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted."},"MonitorsMonitor":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/MonitorsMode"},"id":{"type":"string","example":"mon_123"},"name":{"type":"string","example":"Acme pricing monitor"},"target":{"$ref":"#/components/schemas/MonitorsTarget"},"change_detection":{"$ref":"#/components/schemas/MonitorsChangeDetection"},"schedule":{"$ref":"#/components/schemas/MonitorsSchedule"},"webhook":{"$ref":"#/components/schemas/MonitorsNullableWebhookConfig"},"status":{"$ref":"#/components/schemas/MonitorsMonitorStatus"},"last_run_at":{"type":["string","null"],"format":"date-time"},"last_change_at":{"type":["string","null"],"format":"date-time"},"next_run_at":{"type":["string","null"],"format":"date-time","description":"When the next scheduled run is due."},"last_error":{"anyOf":[{"allOf":[{"$ref":"#/components/schemas/MonitorsRunError"}]},{"type":"null"}],"description":"Error from the most recent failed run; null when the last run succeeded."},"webhook_failure":{"allOf":[{"$ref":"#/components/schemas/MonitorsWebhookFailure"}],"nullable":true,"description":"Present while webhook deliveries are failing consecutively; null when deliveries are healthy or no webhook is configured. Cleared on the next successful delivery and when the webhook URL changes."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20,"uniqueItems":true,"description":"User-defined tags for grouping and filtering monitors and their changes. Duplicates are removed.","example":["pricing","competitor"]},"baseline":{"oneOf":[{"$ref":"#/components/schemas/MonitorsPageBaseline"},{"$ref":"#/components/schemas/MonitorsSitemapBaseline"},{"$ref":"#/components/schemas/MonitorsExtractBaseline"},{"type":"null"}],"description":"Current baseline: the last observed value the monitor compares new snapshots against. Its shape follows `target.type` (page/sitemap/extract). Only populated on GET /monitors/{monitor_id}; null until the first baseline run completes (and after a target or change_detection update, which resets the baseline)."}},"required":["mode","id","name","target","change_detection","schedule","status","created_at","updated_at"],"additionalProperties":false,"title":"Monitor","description":"A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic)."},"MonitorsCreateMonitorResponse":{"allOf":[{"$ref":"#/components/schemas/MonitorsMonitor"},{"type":"object","required":["initial_run_id"],"properties":{"initial_run_id":{"type":["string","null"],"description":"The baseline run queued by this create call, or null if it could not be queued immediately (in which case the baseline runs on the next scheduled tick). Poll GET /monitors/{monitor_id}/runs/{run_id}.","example":"run_123"}}}],"title":"Create monitor response","description":"A newly created monitor plus `initial_run_id`, the id of the baseline run queued at creation."},"MonitorsTargetType":{"type":"string","enum":["page","sitemap","extract"],"description":"The MonitorsTargetType schema."},"MonitorsChangeDetectionType":{"type":"string","enum":["exact","semantic"],"description":"The MonitorsChangeDetectionType schema."},"MonitorsScheduleType":{"type":"string","enum":["interval","cron","exact_time"],"description":"Schedule strategy discriminator. `cron` and `exact_time` are reserved for future use and are not yet accepted."},"MonitorsRunStatus":{"type":"string","enum":["queued","running","completed","failed","skipped"],"description":"Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (insufficient credits, monitor paused, or superseded by a concurrent run)."},"MonitorsNullableRunError":{"anyOf":[{"allOf":[{"$ref":"#/components/schemas/MonitorsRunError"}]},{"type":"null"}],"description":"The MonitorsNullableRunError schema."},"MonitorsWebhookDelivery":{"type":"object","properties":{"event_id":{"type":"string","description":"Identifier sent in the X-Context-Id header.","example":"evt_123"},"event":{"type":"string","enum":["change.detected","run.completed"],"description":"The event this delivery carried. Deliveries recorded before event selection existed report change.detected."},"status":{"type":"string","enum":["delivered","rejected","failed","skipped_unsafe_url"],"description":"Delivery outcome. delivered means any 2xx response; rejected means a non-2xx response; failed means no HTTP response was received; skipped_unsafe_url means the URL failed the public-endpoint safety check."},"http_status":{"type":["integer","null"],"minimum":100,"maximum":599,"description":"The endpoint's final HTTP response status, or null when no response was received.","example":200},"attempted_at":{"type":"string","format":"date-time"},"error":{"$ref":"#/components/schemas/MonitorsNullableRunError"}},"required":["event_id","event","status","http_status","attempted_at","error"],"additionalProperties":false,"x-stainless-model":"monitors.webhook_delivery","description":"The MonitorsWebhookDelivery schema."},"MonitorsRun":{"type":"object","properties":{"id":{"type":"string","example":"run_123"},"monitor_id":{"type":"string","example":"mon_123"},"status":{"$ref":"#/components/schemas/MonitorsRunStatus"},"run_type":{"type":"string","enum":["baseline","scheduled"],"description":"The first run after monitor creation is a baseline run."},"target_type":{"$ref":"#/components/schemas/MonitorsTargetType"},"change_detection_type":{"$ref":"#/components/schemas/MonitorsChangeDetectionType"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"change_detected":{"type":"boolean","example":true},"change_id":{"type":["string","null"],"example":"chg_123"},"baseline_created":{"type":"boolean","description":"True when this run established the monitor's initial baseline; baseline runs perform no change detection."},"credits_charged":{"type":"integer","minimum":0,"description":"Credits charged for this run (0 for skipped/failed runs).","example":1},"skip_reason":{"type":["string","null"],"enum":["insufficient_credits","monitor_paused","superseded",null],"description":"Why a skipped run never executed; null unless status is `skipped`."},"error":{"$ref":"#/components/schemas/MonitorsNullableRunError"},"webhook_delivery":{"$ref":"#/components/schemas/MonitorsWebhookDelivery","deprecated":true,"description":"Deprecated: use `webhook_deliveries`, which records every attempt now that a run can deliver multiple events. Omitted when no webhook was attempted, including historical runs created before delivery tracking was added."},"webhook_deliveries":{"type":"array","items":{"$ref":"#/components/schemas/MonitorsWebhookDelivery"},"description":"All webhook deliveries attempted by this run — one per subscribed event that fired. Omitted when no webhook was attempted, including runs created before event selection was added."}},"required":["id","monitor_id","status","run_type","target_type","change_detection_type","change_detected","baseline_created","credits_charged"],"additionalProperties":false,"description":"The MonitorsRun schema."},"MonitorsImportance":{"type":"string","enum":["low","medium","high"],"description":"The MonitorsImportance schema."},"MonitorsChangeSummary":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/MonitorsMode"},"id":{"type":"string","example":"chg_123"},"monitor_id":{"type":"string","example":"mon_123"},"target_type":{"$ref":"#/components/schemas/MonitorsTargetType"},"change_detection_type":{"$ref":"#/components/schemas/MonitorsChangeDetectionType"},"title":{"type":"string","example":"Acme pricing page changed"},"summary":{"type":"string","example":"The visible text on the page changed."},"detected_at":{"type":"string","format":"date-time"},"url":{"type":"string","format":"uri"},"importance":{"$ref":"#/components/schemas/MonitorsImportance"},"confidence":{"type":"number","minimum":0,"maximum":1},"added_url_count":{"type":"integer","minimum":0},"removed_url_count":{"type":"integer","minimum":0},"matched_url_count":{"type":"integer","minimum":0},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20,"uniqueItems":true,"description":"User-defined tags for grouping and filtering monitors and their changes. Duplicates are removed.","example":["pricing","competitor"]}},"required":["mode","id","monitor_id","target_type","change_detection_type","title","summary","detected_at","url"],"additionalProperties":false,"title":"Change summary","description":"A lightweight change summary. `mode` is the constant `web`; `target_type` and `change_detection_type` describe the change, and which optional fields are present depends on them (e.g. sitemap changes include `added_url_count`/`removed_url_count`; semantic changes include `confidence`/`importance`)."},"MonitorsEvidence":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Optional URL the evidence relates to. Absent for whole-target diffs."},"before":{"type":"string","description":"Snapshot of the content before the change."},"after":{"type":"string","description":"Snapshot of the content after the change."}},"required":["before","after"],"additionalProperties":false,"description":"The MonitorsEvidence schema."},"MonitorsChange":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/MonitorsMode"},"id":{"type":"string","example":"chg_123"},"monitor_id":{"type":"string","example":"mon_123"},"run_id":{"type":"string","example":"run_123","description":"The run that detected this change."},"target_type":{"$ref":"#/components/schemas/MonitorsTargetType"},"change_detection_type":{"$ref":"#/components/schemas/MonitorsChangeDetectionType"},"title":{"type":"string","example":"Acme pricing page changed"},"summary":{"type":"string","example":"The visible text on the page changed."},"detected_at":{"type":"string","format":"date-time"},"url":{"type":"string","format":"uri"},"importance":{"$ref":"#/components/schemas/MonitorsImportance"},"confidence":{"type":"number","minimum":0,"maximum":1},"diff":{"type":"string","description":"Text diff between the previous and current page baseline (page targets)."},"before_text_excerpt":{"type":"string"},"after_text_excerpt":{"type":"string"},"added_urls":{"type":"array","items":{"type":"string","format":"uri"},"description":"At most 500 URLs are included; the corresponding count field is always exact."},"removed_urls":{"type":"array","items":{"type":"string","format":"uri"},"description":"At most 500 URLs are included; the corresponding count field is always exact."},"added_url_count":{"type":"integer","minimum":0},"removed_url_count":{"type":"integer","minimum":0},"matched_urls":{"type":"array","items":{"type":"string","format":"uri"},"description":"At most 500 URLs are included; the corresponding count field is always exact."},"matched_url_count":{"type":"integer","minimum":0},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/MonitorsEvidence"}},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20,"uniqueItems":true,"description":"User-defined tags for grouping and filtering monitors and their changes. Duplicates are removed.","example":["pricing","competitor"]}},"required":["mode","id","monitor_id","run_id","target_type","change_detection_type","title","summary","detected_at","url","tags"],"additionalProperties":false,"title":"Change","description":"A detected change. `mode` is the constant `web`; `target_type` and `change_detection_type` describe the change, and which optional fields are present depends on them (page: `diff` + excerpts; sitemap: `added_urls`/`removed_urls`; semantic: `confidence`/`importance`/`evidence`/`matched_urls`)."},"MonitorsListMonitorsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MonitorsMonitor"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false,"description":"The MonitorsListMonitorsResponse schema."},"MonitorsListRunsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MonitorsRun"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false,"description":"The MonitorsListRunsResponse schema."},"MonitorsListChangesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MonitorsChangeSummary"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false,"description":"The MonitorsListChangesResponse schema."},"MonitorsDeleteMonitorResponse":{"type":"object","properties":{"id":{"type":"string","example":"mon_123"},"deleted":{"type":"boolean","example":true}},"required":["id","deleted"],"additionalProperties":false,"description":"The MonitorsDeleteMonitorResponse schema."},"MonitorsChangeDetectedWebhookPayload":{"type":"object","properties":{"event":{"type":"string","enum":["change.detected"]},"id":{"type":"string","example":"evt_123"},"created_at":{"type":"string","format":"date-time","example":"2026-07-09T18:00:12.000Z"},"data":{"type":"object","properties":{"change":{"$ref":"#/components/schemas/MonitorsChange"}},"required":["change"],"additionalProperties":false}},"required":["event","id","created_at","data"],"additionalProperties":false,"title":"Monitor change detected webhook payload","description":"Payload sent when a monitor detects a change. The nested change is the same full change record returned by GET /monitors/changes/{change_id}."},"MonitorsRunCompletedWebhookPayload":{"type":"object","properties":{"event":{"type":"string","enum":["run.completed"]},"id":{"type":"string","example":"evt_123"},"created_at":{"type":"string","format":"date-time","example":"2026-07-09T18:00:12.000Z"},"data":{"type":"object","properties":{"run":{"type":"object","properties":{"id":{"type":"string","example":"run_123"},"monitor_id":{"type":"string","example":"mon_123"},"status":{"type":"string","enum":["completed"]},"run_type":{"type":"string","enum":["baseline","scheduled"],"description":"The first run after monitor creation is a baseline run."},"target_type":{"$ref":"#/components/schemas/MonitorsTargetType"},"change_detection_type":{"$ref":"#/components/schemas/MonitorsChangeDetectionType"},"started_at":{"type":"string","format":"date-time"},"completed_at":{"type":"string","format":"date-time"},"change_detected":{"type":"boolean","example":false},"change_id":{"type":["string","null"],"example":null},"baseline_created":{"type":"boolean","description":"True when this run established the monitor's initial baseline; baseline runs perform no change detection."}},"required":["id","monitor_id","status","run_type","target_type","change_detection_type","started_at","completed_at","change_detected","change_id","baseline_created"],"additionalProperties":false,"title":"Completed run snapshot","description":"Snapshot of the run at delivery time. Billing detail (credits_charged) is settled after delivery, so fetch the run via GET /monitors/{monitor_id}/runs for the full record."},"change":{"anyOf":[{"$ref":"#/components/schemas/MonitorsChange"},{"type":"null"}],"description":"The detected change — the same full change record delivered by change.detected — or null when the run found no change."}},"required":["run","change"],"additionalProperties":false}},"required":["event","id","created_at","data"],"additionalProperties":false,"title":"Monitor run completed webhook payload","description":"Payload sent after every completed run when the monitor's webhook subscribes to run.completed. A run with `change_detected: false` is a confirmation that the monitor ran and found no change."},"MonitorsRunNowResponse":{"type":"object","properties":{"monitor_id":{"type":"string","example":"mon_123"},"run_id":{"type":"string","example":"run_123","description":"The queued run. Poll GET /monitors/{monitor_id}/runs or use it to correlate results."},"queued":{"type":"boolean","example":true}},"required":["monitor_id","run_id","queued"],"additionalProperties":false,"description":"The MonitorsRunNowResponse schema."},"MonitorsCreditUsage":{"type":"object","properties":{"monitor_id":{"type":"string","example":"mon_123"},"name":{"type":"string","description":"Monitor name (falls back to the id when the monitor was deleted)."},"credits":{"type":"integer","description":"Credits charged to this monitor over the window."},"runs":{"type":"integer","description":"Number of billed runs over the window."}},"required":["monitor_id","name","credits","runs"],"additionalProperties":false,"title":"Monitor credit usage","description":"The MonitorsCreditUsage schema."},"MonitorsCreditUsageResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MonitorsCreditUsage"}},"total_credits":{"type":"integer","description":"Sum of credits across all monitors in the window."}},"required":["data","total_credits"],"additionalProperties":false,"title":"Monitor credit usage response","description":"The MonitorsCreditUsageResponse schema."},"MonitorsLimitsResponse":{"type":"object","properties":{"monitors_used":{"type":"integer","description":"Number of monitors the account currently has."},"monitors_limit":{"type":"integer","description":"Maximum number of monitors allowed for the account. Defaults to the plan allowance unless a custom limit is set for the organization."},"plan":{"type":"string","enum":["free","starter","pro","scale"],"description":"The plan tier the limit was resolved from."}},"required":["monitors_used","monitors_limit","plan"],"additionalProperties":false,"title":"Monitor limits response","description":"The MonitorsLimitsResponse schema."},"WebdbsSchema":{"type":"object","additionalProperties":true,"title":"WebDB row schema","description":"JSON Schema for the fields extracted into each row. Zod users can pass the output of z.toJSONSchema().","example":{"type":"object","properties":{"title":{"type":"string","description":"Product name."},"price":{"type":"number","description":"Current price."}},"required":["title"],"additionalProperties":false}},"WebdbsEligibility":{"type":"object","properties":{"prefilter":{"type":"object","properties":{"url_match":{"type":"array","items":{"type":"string"},"maxItems":50,"example":["https://shop.com/products/:product_id","https://foo.com/item?id=*","https://foo.com/bar/*","**/events/**"],"description":"URL patterns a page must match. Supports exact URLs, `*`, `**`, and `:name` path values."},"must_contain_any":{"type":"array","items":{"type":"string"},"maxItems":50,"description":"Text where at least one value must appear."},"must_not_contain":{"type":"array","items":{"type":"string"},"maxItems":50,"description":"Text values that must not appear."}},"additionalProperties":false,"description":"Fast URL and text checks."},"semantic":{"type":"object","properties":{"condition":{"type":"string","minLength":1,"maxLength":4000,"description":"Plain-language rule a page must satisfy."},"min_score":{"type":"number","minimum":0,"maximum":1,"description":"Minimum matching score from 0 to 1. Defaults to 0.7."}},"required":["condition"],"additionalProperties":false,"description":"AI check for whether a page should become a row."}},"additionalProperties":false,"description":"Rules that decide whether a page becomes a row.","title":"WebDB eligibility rules"},"WebdbsSync":{"type":"object","properties":{"every":{"type":"string","example":"6h","description":"Sync interval such as `6h`, or a five-field cron expression."},"mode":{"type":"string","enum":["incremental","full"],"default":"incremental","description":"Use `incremental` for changed pages or `full` for every page."}},"required":["every"],"additionalProperties":false,"title":"WebDB sync schedule","description":"Controls when pages are checked for updates."},"WebdbsUrlTarget":{"type":"object","properties":{"type":{"type":"string","enum":["url"],"description":"Fetch one URL."},"seeds":{"type":"array","items":{"type":"string","format":"uri"},"description":"URL to fetch."},"id":{"type":"string","example":"tgt_123","description":"Stable target ID. Omit it when adding a target."},"sync":{"allOf":[{"$ref":"#/components/schemas/WebdbsSync"},{"description":"Schedule for this target."}]},"eligibility":{"allOf":[{"$ref":"#/components/schemas/WebdbsEligibility"},{"description":"Extra eligibility rules for this target."}]},"crawl_options":{"type":"object","additionalProperties":{},"description":"Optional page loading settings."}},"required":["type","seeds"],"additionalProperties":false,"title":"URL target","description":"Fetches exactly one page."},"WebdbsUrlListTarget":{"type":"object","properties":{"type":{"type":"string","enum":["url_list"],"description":"Fetch a fixed list of URLs."},"seeds":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":10000,"description":"URLs to fetch. Maximum 10000."},"id":{"type":"string","example":"tgt_123","description":"Stable target ID. Omit it when adding a target."},"sync":{"allOf":[{"$ref":"#/components/schemas/WebdbsSync"},{"description":"Schedule for this target."}]},"eligibility":{"allOf":[{"$ref":"#/components/schemas/WebdbsEligibility"},{"description":"Extra eligibility rules for this target."}]},"crawl_options":{"type":"object","additionalProperties":{},"description":"Optional page loading settings."}},"required":["type","seeds"],"additionalProperties":false,"title":"URL list target","description":"Fetches a fixed set of pages."},"WebdbsSitemapTarget":{"type":"object","properties":{"type":{"type":"string","enum":["sitemap"],"description":"Discover URLs from sitemaps."},"seeds":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":10,"description":"Sitemap URLs to read. Maximum 10."},"ingest":{"type":"object","properties":{"match":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100,"example":["https://shop.com/products/:product_id","https://foo.com/item?id=*","https://foo.com/bar/*","**/events/**"],"description":"URL patterns for pages that become rows. Supports exact URLs, `*`, `**`, and `:name` path values."}},"required":["match"],"additionalProperties":false,"description":"Rules for choosing pages to save as rows."},"id":{"type":"string","example":"tgt_123","description":"Stable target ID. Omit it when adding a target."},"sync":{"allOf":[{"$ref":"#/components/schemas/WebdbsSync"},{"description":"Schedule for this target."}]},"eligibility":{"allOf":[{"$ref":"#/components/schemas/WebdbsEligibility"},{"description":"Extra eligibility rules for this target."}]},"crawl_options":{"type":"object","additionalProperties":{},"description":"Optional page loading settings."},"max_pages":{"type":"integer","minimum":1,"maximum":1000000,"default":10000,"description":"Maximum pages processed for this target per sync."}},"required":["type","seeds"],"additionalProperties":false,"title":"Sitemap target","description":"Expands sitemap URLs into pages."},"WebdbsCrawlTarget":{"type":"object","properties":{"type":{"type":"string","enum":["crawl"],"description":"Crawl links from starting URLs."},"seeds":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":100,"description":"URLs where the crawl starts. Maximum 100."},"follow":{"type":"object","properties":{"match":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100,"example":["https://shop.com/products/:product_id","https://foo.com/item?id=*","https://foo.com/bar/*","**/events/**"],"description":"URL patterns for links to follow. Supports exact URLs, `*`, `**`, and `:name` path values."},"max_depth":{"type":"integer","minimum":1,"maximum":10,"description":"Maximum link depth from each starting URL."}},"required":["match"],"additionalProperties":false,"description":"Rules for which links the crawl follows."},"ingest":{"type":"object","properties":{"match":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100,"example":["https://shop.com/products/:product_id","https://foo.com/item?id=*","https://foo.com/bar/*","**/events/**"],"description":"URL patterns for pages that become rows. Supports exact URLs, `*`, `**`, and `:name` path values."}},"required":["match"],"additionalProperties":false,"description":"Rules for choosing pages to save as rows."},"id":{"type":"string","example":"tgt_123","description":"Stable target ID. Omit it when adding a target."},"sync":{"allOf":[{"$ref":"#/components/schemas/WebdbsSync"},{"description":"Schedule for this target."}]},"eligibility":{"allOf":[{"$ref":"#/components/schemas/WebdbsEligibility"},{"description":"Extra eligibility rules for this target."}]},"crawl_options":{"type":"object","additionalProperties":{},"description":"Optional page loading settings."},"max_pages":{"type":"integer","minimum":1,"maximum":1000000,"default":100,"description":"Maximum pages processed for this target per sync."}},"required":["type","seeds","ingest"],"additionalProperties":false,"title":"Crawl target","description":"Crawls a site and saves matching pages as rows."},"WebdbsTarget":{"oneOf":[{"$ref":"#/components/schemas/WebdbsUrlTarget"},{"$ref":"#/components/schemas/WebdbsUrlListTarget"},{"$ref":"#/components/schemas/WebdbsSitemapTarget"},{"$ref":"#/components/schemas/WebdbsCrawlTarget"}],"discriminator":{"propertyName":"type","mapping":{"url":"#/components/schemas/WebdbsUrlTarget","url_list":"#/components/schemas/WebdbsUrlListTarget","sitemap":"#/components/schemas/WebdbsSitemapTarget","crawl":"#/components/schemas/WebdbsCrawlTarget"}},"description":"Source that provides pages for a collection."},"WebdbsChangeTracking":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether to record row changes."},"granularity":{"type":"string","enum":["field"],"description":"Records changes for each field."},"retention":{"type":"string","pattern":"^(\\d+)(s|m|h|d)$","default":"90d","description":"How long to keep row changes, such as `90d`."}},"required":["enabled"],"additionalProperties":false,"title":"WebDB change tracking","description":"Controls row change history."},"WebdbsBudgets":{"type":"object","properties":{"credits":{"type":"integer","exclusiveMinimum":0,"description":"Maximum credits this collection can use."}},"additionalProperties":false,"title":"WebDB spending limits","description":"Optional spending limits for a collection."},"WebdbsRunError":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code."},"message":{"type":"string","description":"Human-readable error message."}},"required":["code","message"],"additionalProperties":false,"title":"WebDB run error","description":"Error reported by a collection run."},"WebdbsCollection":{"type":"object","properties":{"id":{"type":"string","example":"col_123","description":"Collection ID."},"name":{"type":"string","description":"Collection name."},"description":{"type":["string","null"],"description":"Optional collection description."},"schema":{"allOf":[{"$ref":"#/components/schemas/WebdbsSchema"}],"description":"JSON Schema for each row."},"eligibility":{"description":"Rules for deciding which pages become rows.","anyOf":[{"allOf":[{"$ref":"#/components/schemas/WebdbsEligibility"}]},{"type":"null"}]},"targets":{"type":"array","items":{"$ref":"#/components/schemas/WebdbsTarget"},"description":"Sources that provide pages for this collection."},"sync":{"allOf":[{"$ref":"#/components/schemas/WebdbsSync"},{"description":"Collection sync schedule."}]},"change_tracking":{"allOf":[{"$ref":"#/components/schemas/WebdbsChangeTracking"},{"description":"Row change history settings."}]},"budgets":{"description":"Collection spending limits.","anyOf":[{"allOf":[{"$ref":"#/components/schemas/WebdbsBudgets"}]},{"type":"null"}]},"on_disappear":{"type":"string","enum":["soft_delete","hard_delete","keep"],"description":"Action when a source page disappears or becomes ineligible."},"stale_after":{"type":"integer","description":"Missed syncs before a row becomes stale."},"status":{"type":"string","enum":["active","paused","failed"],"description":"Current collection status."},"next_sync_at":{"type":["string","null"],"format":"date-time","description":"Next scheduled sync time."},"last_run_at":{"type":["string","null"],"format":"date-time","description":"Time the latest run started."},"last_error":{"anyOf":[{"allOf":[{"$ref":"#/components/schemas/WebdbsRunError"}]},{"type":"null"}],"description":"Run error, or null when no error was reported."},"row_count":{"type":"integer","description":"Current number of rows."},"credits_consumed_total":{"type":"integer","description":"Total credits used by this collection."},"sync_count":{"type":"integer","description":"Number of completed syncs."},"created_at":{"type":"string","format":"date-time","description":"Time the collection was created."},"updated_at":{"type":"string","format":"date-time","description":"Time the collection was last updated."}},"required":["id","name","schema","eligibility","targets","sync","change_tracking","budgets","on_disappear","stale_after","status","next_sync_at","last_run_at","last_error","row_count","credits_consumed_total","sync_count","created_at","updated_at"],"additionalProperties":false,"title":"WebDB collection","description":"A table of structured data kept up to date from web pages."},"WebdbsCreateCollectionRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Collection name."},"description":{"type":"string","maxLength":2000,"description":"Optional collection description."},"schema":{"allOf":[{"$ref":"#/components/schemas/WebdbsSchema"}],"description":"JSON Schema for each row."},"eligibility":{"allOf":[{"$ref":"#/components/schemas/WebdbsEligibility"},{"description":"Rules for deciding which pages become rows."}]},"targets":{"type":"array","items":{"$ref":"#/components/schemas/WebdbsTarget"},"minItems":1,"maxItems":20,"description":"Sources that provide pages for the collection."},"sync":{"allOf":[{"$ref":"#/components/schemas/WebdbsSync"},{"description":"Collection sync schedule. Defaults to once per day."}]},"change_tracking":{"allOf":[{"$ref":"#/components/schemas/WebdbsChangeTracking"},{"description":"Row change history settings."}]},"budgets":{"allOf":[{"$ref":"#/components/schemas/WebdbsBudgets"},{"description":"Optional collection spending limits."}]},"on_disappear":{"type":"string","enum":["soft_delete","hard_delete","keep"],"default":"soft_delete","description":"Action for rows whose source page disappears or becomes ineligible."},"stale_after":{"type":"integer","minimum":1,"maximum":50,"default":3,"description":"Missed syncs before a row becomes stale."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["name","schema","targets"],"additionalProperties":false,"title":"Create WebDB collection request","description":"Settings for a new WebDB collection."},"WebdbsUpdateCollectionRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Collection name."},"description":{"type":"string","maxLength":2000,"description":"Optional collection description."},"schema":{"allOf":[{"$ref":"#/components/schemas/WebdbsSchema"}],"description":"JSON Schema for each row."},"eligibility":{"allOf":[{"$ref":"#/components/schemas/WebdbsEligibility"},{"description":"Rules for deciding which pages become rows."}]},"targets":{"type":"array","items":{"$ref":"#/components/schemas/WebdbsTarget"},"minItems":1,"maxItems":20,"description":"Complete replacement list of collection targets."},"sync":{"allOf":[{"$ref":"#/components/schemas/WebdbsSync"},{"description":"Collection sync schedule."}]},"change_tracking":{"allOf":[{"$ref":"#/components/schemas/WebdbsChangeTracking"},{"description":"Row change history settings."}]},"budgets":{"allOf":[{"$ref":"#/components/schemas/WebdbsBudgets"},{"description":"Optional collection spending limits."}]},"on_disappear":{"type":"string","enum":["soft_delete","hard_delete","keep"],"description":"Action for rows whose source page disappears or becomes ineligible."},"stale_after":{"type":"integer","minimum":1,"maximum":50,"description":"Missed syncs before a row becomes stale."},"status":{"type":"string","enum":["active","paused"],"description":"Pause or resume syncing."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"additionalProperties":false,"title":"Update WebDB collection request","description":"Fields to update on a WebDB collection."},"WebdbsListCollectionsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebdbsCollection"},"description":"Collections in this page."},"has_more":{"type":"boolean","description":"Whether another page is available."},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null at the end."},"key_metadata":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"description":"API key usage for this request."}]}},"required":["data","has_more","next_cursor"],"additionalProperties":false,"description":"A page of WebDB collections."},"WebdbsDeleteResponse":{"type":"object","properties":{"id":{"type":"string","description":"Deleted resource ID."},"deleted":{"type":"boolean","example":true,"description":"Whether the resource was deleted."},"key_metadata":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"description":"API key usage for this request."}]}},"required":["id","deleted"],"additionalProperties":false,"title":"WebDB delete response","description":"Confirms that a WebDB resource was deleted."},"WebdbsRunQueuedResponse":{"type":"object","properties":{"collection_id":{"type":"string","example":"col_123","description":"Collection ID."},"run_id":{"type":"string","example":"run_123","description":"Queued run ID."},"queued":{"type":"boolean","example":true,"description":"Whether the run was queued."},"key_metadata":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"description":"API key usage for this request."}]}},"required":["collection_id","run_id","queued"],"additionalProperties":false,"title":"WebDB run queued response","description":"Confirms that a collection run was queued."},"WebdbsReprocessRequest":{"type":"object","properties":{"where":{"type":"object","additionalProperties":{},"description":"Rows to reprocess. Omit to reprocess every row."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"additionalProperties":false,"title":"WebDB reprocess request","description":"Selects rows to extract again from saved pages."},"WebdbsPurgeRequest":{"type":"object","properties":{"url_match":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50,"example":["https://shop.com/products/:product_id","https://foo.com/item?id=*","https://foo.com/bar/*","**/events/**"],"description":"URL patterns for rows to permanently delete. Supports exact URLs, `*`, `**`, and `:name` path values."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["url_match"],"additionalProperties":false,"title":"WebDB purge request","description":"Selects rows to permanently delete by URL."},"WebdbsRowMeta":{"type":"object","properties":{"first_seen_at":{"type":"string","format":"date-time","description":"Time this row was first found."},"last_checked_at":{"type":"string","format":"date-time","description":"Time this row was last checked."},"last_changed_at":{"type":["string","null"],"format":"date-time","description":"Time the row values last changed."},"change_count":{"type":"integer","description":"Number of times the row changed."},"version":{"type":"integer","description":"Current row version."},"eligibility_score":{"type":["number","null"],"description":"Latest page eligibility score."},"extraction_confidence":{"type":["number","null"],"description":"Latest extraction confidence score."},"content_hash":{"type":["string","null"],"description":"Hash of the latest page content."},"credits_used":{"type":"integer","description":"Credits used to produce this row."},"capped_at":{"type":["string","null"],"format":"date-time","description":"Time a credit limit stopped updates for this row."},"snapshot":{"type":["object","null"],"properties":{"html_url":{"type":"string","description":"Temporary URL for the saved HTML."},"markdown_url":{"type":"string","description":"Temporary URL for the saved Markdown."},"captured_at":{"type":"string","format":"date-time","description":"Time the page snapshot was saved."}},"required":["captured_at"],"additionalProperties":false,"description":"Latest saved page snapshot."},"params":{"type":["object","null"],"properties":{"path":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Values captured from named URL path segments."},"search":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Values captured from URL query parameters."}},"required":["path","search"],"additionalProperties":false,"description":"Values captured from the matching URL pattern."},"source":{"type":"object","properties":{"target_id":{"type":"string","example":"tgt_123","description":"Target that found this page."},"entry_urls":{"type":"array","items":{"type":"string"},"description":"Starting URLs that led to this page."}},"required":["target_id","entry_urls"],"additionalProperties":false,"description":"Source information for this row."},"fields":{"type":"object","additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["extracted","missing","invalid","low_confidence"],"description":"Extraction status for this field."},"confidence":{"type":["number","null"],"description":"Confidence score for this field."},"changed_at":{"type":"string","format":"date-time","description":"Time this field last changed."}},"required":["status","confidence"],"additionalProperties":false},"description":"Extraction details for each field."}},"required":["first_seen_at","last_checked_at","last_changed_at","change_count","version","eligibility_score","extraction_confidence","content_hash","credits_used","capped_at","snapshot","params","source","fields"],"additionalProperties":false,"title":"WebDB row metadata","description":"System details about a WebDB row."},"WebdbsRow":{"type":"object","properties":{"_id":{"type":"string","example":"row_1a2b3c","description":"Row ID."},"_url":{"type":"string","description":"Final URL used to create the row."},"_status":{"type":"string","enum":["pending","active","stale","removed","error","cap_consumed"],"description":"Current row status."},"_collection":{"type":"string","example":"col_123","description":"Collection ID."},"_meta":{"allOf":[{"$ref":"#/components/schemas/WebdbsRowMeta"},{"description":"System details for this row."}]}},"required":["_id","_url","_status","_collection","_meta"],"additionalProperties":true,"title":"WebDB row","description":"Extracted page data with system fields prefixed by an underscore."},"WebdbsQueryRequest":{"type":"object","properties":{"where":{"type":"object","additionalProperties":{},"description":"Filters rows by field values. Supports comparisons, lists, text matching, and boolean groups."},"order_by":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"Field used to sort rows."},"dir":{"type":"string","enum":["asc","desc"],"default":"asc","description":"Sort direction."}},"required":["field"],"additionalProperties":false},"maxItems":3,"description":"Fields used to sort the results."},"select":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50,"description":"Fields to include in each row. `_id` is always included."},"limit":{"type":"integer","minimum":1,"maximum":200,"default":25,"description":"Maximum rows to return. Defaults to 25."},"cursor":{"type":"string","description":"Pagination cursor from a previous query."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"additionalProperties":false,"title":"WebDB query request","description":"Filters, sorts, and selects fields from collection rows."},"WebdbsQueryResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebdbsRow"},"description":"Rows in this page."},"has_more":{"type":"boolean","description":"Whether another page is available."},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null at the end."},"scan_limited":{"type":"boolean","description":"Whether the query stopped before scanning every possible match."},"key_metadata":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"description":"API key usage for this request."}]}},"required":["data","has_more","next_cursor"],"additionalProperties":false,"title":"WebDB query response","description":"A page of rows matching a query."},"WebdbsRunStats":{"type":"object","properties":{"pages_fetched":{"type":"integer","description":"Pages fetched during the run."},"eligible":{"type":"integer","description":"Pages accepted as rows."},"rejected":{"type":"integer","description":"Pages rejected by eligibility rules."},"rows_created":{"type":"integer","description":"Rows created during the run."},"rows_updated":{"type":"integer","description":"Rows updated during the run."},"rows_unchanged":{"type":"integer","description":"Rows that did not change."},"rows_removed":{"type":"integer","description":"Rows marked as removed."},"rows_errored":{"type":"integer","description":"Rows that could not be processed."},"rows_capped":{"type":"integer","description":"Rows paused by a credit limit."},"credits_consumed":{"type":"integer","description":"Credits used by the run."}},"required":["pages_fetched","eligible","rejected","rows_created","rows_updated","rows_unchanged","rows_removed","rows_errored","rows_capped","credits_consumed"],"additionalProperties":false,"title":"WebDB run stats","description":"Counts recorded during a collection run."},"WebdbsRun":{"type":"object","properties":{"id":{"type":"string","example":"run_123","description":"Run ID."},"collection_id":{"type":"string","example":"col_123","description":"Collection ID."},"status":{"type":"string","enum":["queued","running","completed","partial","failed","skipped"],"description":"Current run status."},"trigger":{"type":"string","enum":["initial","scheduled","manual","reprocess","purge"],"description":"Action that started the run."},"stats":{"allOf":[{"$ref":"#/components/schemas/WebdbsRunStats"},{"description":"Run totals."}]},"by_target":{"type":"array","items":{"type":"object","properties":{"target_id":{"type":"string","example":"tgt_123","description":"Target ID."},"coverage":{"type":"string","enum":["full","truncated"],"description":"Whether the target finished every planned page."},"pages_fetched":{"type":"integer","description":"Pages fetched from this target."},"errors":{"type":"integer","description":"Errors from this target."}},"required":["target_id","coverage","pages_fetched","errors"],"additionalProperties":false},"description":"Results for each target."},"errors":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Error type."},"count":{"type":"integer","description":"Number of errors of this type."}},"required":["type","count"],"additionalProperties":false},"description":"Errors grouped by type."},"capped_url_count":{"type":"integer","description":"URLs skipped because a credit limit was reached."},"skip_reason":{"type":["string","null"],"enum":["insufficient_credits","collection_paused","superseded",null],"description":"Why a skipped run did not start."},"error":{"anyOf":[{"allOf":[{"$ref":"#/components/schemas/WebdbsRunError"}]},{"type":"null"}],"description":"Run error, or null when no error was reported."},"started_at":{"type":["string","null"],"format":"date-time","description":"Time the run started."},"completed_at":{"type":["string","null"],"format":"date-time","description":"Time the run finished."},"created_at":{"type":"string","format":"date-time","description":"Time the run was created."}},"required":["id","collection_id","status","trigger","stats","by_target","errors","capped_url_count","skip_reason","started_at","completed_at","created_at"],"additionalProperties":false,"title":"WebDB run","description":"Status and results for a sync, reprocess, or purge action."},"WebdbsListRunsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebdbsRun"},"description":"Runs in this page."},"has_more":{"type":"boolean","description":"Whether another page is available."},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null at the end."},"key_metadata":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"description":"API key usage for this request."}]}},"required":["data","has_more","next_cursor"],"additionalProperties":false,"description":"A page of collection runs."},"WebdbsRowChange":{"type":"object","properties":{"id":{"type":"string","description":"Change event ID."},"row_id":{"type":"string","example":"row_1a2b3c","description":"Changed row ID."},"collection_id":{"type":"string","example":"col_123","description":"Collection ID."},"run_id":{"type":"string","example":"run_123","description":"Run that produced the change."},"event":{"type":"string","enum":["row.created","row.updated","row.removed","row.error","row.cap_consumed"],"description":"Type of row change."},"version":{"type":"integer","description":"Row version produced by this change."},"fields":{"type":["object","null"],"additionalProperties":{"type":"object","properties":{"from":{"description":"Value before the change."},"to":{"description":"Value after the change."}},"additionalProperties":false,"required":["from","to"]},"description":"Changed values by field, or null when no values changed."},"url":{"type":"string","description":"Source page URL."},"at":{"type":"string","format":"date-time","description":"Time the change happened."}},"required":["id","row_id","collection_id","run_id","event","version","fields","url","at"],"additionalProperties":false,"title":"WebDB row change","description":"One recorded change to a row."},"WebdbsListChangesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebdbsRowChange"},"description":"Row changes in this page."},"has_more":{"type":"boolean","description":"Whether another page is available."},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null at the end."},"key_metadata":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"description":"API key usage for this request."}]}},"required":["data","has_more","next_cursor"],"additionalProperties":false,"description":"A page of row changes."},"WebdbsRowHistory":{"type":"object","properties":{"row_id":{"type":"string","example":"row_1a2b3c","description":"Row ID."},"changes":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time","description":"Time the change happened."},"version":{"type":"integer","description":"Row version produced by this change."},"event":{"type":"string","enum":["row.created","row.updated","row.removed","row.error","row.cap_consumed"],"description":"Type of row change."},"fields":{"type":["object","null"],"additionalProperties":{"type":"object","properties":{"from":{"description":"Value before the change."},"to":{"description":"Value after the change."}},"additionalProperties":false,"required":["from","to"]},"description":"Changed values by field, or null when no values changed."}},"required":["at","version","event","fields"],"additionalProperties":false},"description":"Recorded changes, newest first."},"has_more":{"type":"boolean","description":"Whether another page is available."},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null at the end."},"key_metadata":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"description":"API key usage for this request."}]}},"required":["row_id","changes","has_more","next_cursor"],"additionalProperties":false,"title":"WebDB row history","description":"Change history for one row."},"WebdbsRejection":{"type":"object","properties":{"url":{"type":"string","description":"Page URL."},"stage":{"type":"string","enum":["fetch","prefilter","semantic","validation"],"description":"Step where the page was rejected."},"score":{"type":["number","null"],"description":"Eligibility score, or null when no score was used."},"reason":{"type":"string","description":"Reason the page was rejected."},"at":{"type":"string","format":"date-time","description":"Time the page was rejected."}},"required":["url","stage","score","reason","at"],"additionalProperties":false,"title":"WebDB rejection","description":"A page that did not become a row."},"WebdbsListRejectionsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebdbsRejection"},"description":"Rejected pages in this page."},"has_more":{"type":"boolean","description":"Whether another page is available."},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null at the end."},"key_metadata":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"description":"API key usage for this request."}]}},"required":["data","has_more","next_cursor"],"additionalProperties":false,"description":"A page of rejected source pages."},"WebdbsWebhook":{"type":"object","properties":{"id":{"type":"string","example":"wh_123","description":"Webhook ID."},"url":{"type":"string","format":"uri","description":"HTTPS URL that receives events."},"events":{"type":"array","items":{"type":"string","enum":["row.created","row.updated","row.removed","row.error","row.cap_consumed","run.completed","run.failed","credits.low","credits.exhausted"]},"description":"Events sent to this webhook."},"collection_id":{"type":["string","null"],"description":"Collection being watched, or null for all collections."},"on":{"type":["object","null"],"properties":{"fields":{"type":"array","items":{"type":"string"},"description":"Fields that trigger row.updated events."}},"required":["fields"],"additionalProperties":false,"description":"Optional field filter for row.updated events."},"delivery":{"type":"string","enum":["instant","batch"],"description":"Whether events are sent immediately or in batches."},"batch":{"type":["object","null"],"properties":{"max_size":{"type":"integer","minimum":1,"maximum":500,"description":"Maximum events in one batch."},"max_delay":{"type":"string","pattern":"^(\\d+)(s|m|h|d)$","description":"Maximum wait before sending a batch."}},"additionalProperties":false,"description":"Batch delivery settings."},"secret":{"type":"string","description":"Secret used to verify webhook signatures."},"status":{"type":"string","enum":["active","disabled"],"description":"Current webhook status."},"created_at":{"type":"string","format":"date-time","description":"Time the webhook was created."},"updated_at":{"type":"string","format":"date-time","description":"Time the webhook was last updated."}},"required":["id","url","events","collection_id","on","delivery","batch","secret","status","created_at","updated_at"],"additionalProperties":false,"title":"WebDB webhook","description":"Sends WebDB events to an HTTPS endpoint."},"WebdbsCreateWebhookRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"HTTPS URL that receives events."},"events":{"type":"array","items":{"type":"string","enum":["row.created","row.updated","row.removed","row.error","row.cap_consumed","run.completed","run.failed","credits.low","credits.exhausted"]},"minItems":1,"description":"Events sent to this webhook."},"collection_id":{"type":"string","description":"Collection to watch. Omit to watch all collections."},"on":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":20,"description":"Fields that trigger row.updated events."}},"required":["fields"],"additionalProperties":false,"description":"Sends row.updated only when one of these fields changes."},"delivery":{"type":"string","enum":["instant","batch"],"default":"instant","description":"Send events immediately or in batches."},"batch":{"type":"object","properties":{"max_size":{"type":"integer","minimum":1,"maximum":500,"description":"Maximum events in one batch."},"max_delay":{"type":"string","pattern":"^(\\d+)(s|m|h|d)$","description":"Maximum wait before sending a batch."}},"additionalProperties":false,"description":"Batch delivery settings."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["url","events"],"additionalProperties":false,"title":"Create WebDB webhook request","description":"Settings for a new WebDB webhook."},"WebdbsUpdateWebhookRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"HTTPS URL that receives events."},"events":{"type":"array","items":{"type":"string","enum":["row.created","row.updated","row.removed","row.error","row.cap_consumed","run.completed","run.failed","credits.low","credits.exhausted"]},"minItems":1,"description":"Events sent to this webhook."},"collection_id":{"type":"string","description":"Collection to watch."},"on":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":20,"description":"Fields that trigger row.updated events."}},"required":["fields"],"additionalProperties":false,"description":"Sends row.updated only when one of these fields changes."},"delivery":{"type":"string","enum":["instant","batch"],"description":"Send events immediately or in batches."},"batch":{"type":"object","properties":{"max_size":{"type":"integer","minimum":1,"maximum":500,"description":"Maximum events in one batch."},"max_delay":{"type":"string","pattern":"^(\\d+)(s|m|h|d)$","description":"Maximum wait before sending a batch."}},"additionalProperties":false,"description":"Batch delivery settings."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"additionalProperties":false,"title":"Update WebDB webhook request","description":"Fields to update on a WebDB webhook."},"WebdbsListWebhooksResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebdbsWebhook"},"description":"Webhooks in this page."},"has_more":{"type":"boolean","description":"Whether another page is available."},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null at the end."},"key_metadata":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"description":"API key usage for this request."}]}},"required":["data","has_more","next_cursor"],"additionalProperties":false,"description":"A page of WebDB webhooks."},"WebdbsWebhookDelivery":{"type":"object","properties":{"id":{"type":"string","description":"Delivery ID."},"webhook_id":{"type":"string","example":"wh_123","description":"Webhook ID."},"event":{"type":"string","enum":["row.created","row.updated","row.removed","row.error","row.cap_consumed","run.completed","run.failed","credits.low","credits.exhausted"],"description":"Event sent in this delivery."},"status":{"type":"string","enum":["pending","delivered","failed","dead"],"description":"Current delivery status."},"attempts":{"type":"integer","description":"Number of delivery attempts."},"next_attempt_at":{"type":["string","null"],"format":"date-time","description":"Time of the next retry."},"last_error":{"type":["string","null"],"description":"Latest delivery error."},"delivered_at":{"type":["string","null"],"format":"date-time","description":"Time the event was delivered."},"created_at":{"type":"string","format":"date-time","description":"Time the delivery was created."}},"required":["id","webhook_id","event","status","attempts","next_attempt_at","last_error","delivered_at","created_at"],"additionalProperties":false,"title":"WebDB webhook delivery","description":"One attempt to send a webhook event."},"WebdbsListDeliveriesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebdbsWebhookDelivery"},"description":"Deliveries in this page."},"has_more":{"type":"boolean","description":"Whether another page is available."},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null at the end."},"key_metadata":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"description":"API key usage for this request."}]}},"required":["data","has_more","next_cursor"],"additionalProperties":false,"description":"A page of webhook deliveries."},"WebdbsPreviewRequest":{"type":"object","properties":{"urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":5,"description":"URLs to test. Maximum 5."},"schema":{"allOf":[{"$ref":"#/components/schemas/WebdbsSchema"}],"description":"JSON Schema for each row."},"eligibility":{"allOf":[{"$ref":"#/components/schemas/WebdbsEligibility"},{"description":"Rules for deciding which pages become rows."}]},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["urls","schema"],"additionalProperties":false,"title":"WebDB preview request","description":"Tests extraction without creating a collection."},"WebdbsPreviewResult":{"type":"object","properties":{"url":{"type":"string","description":"Requested page URL."},"end_url":{"type":["string","null"],"description":"Final URL after redirects."},"eligibility":{"type":["object","null"],"properties":{"eligible":{"type":"boolean","description":"Whether the page passed eligibility rules."},"score":{"type":["number","null"],"description":"Eligibility score, when available."},"reason":{"type":"string","description":"Reason for the eligibility result."}},"required":["eligible","score","reason"],"additionalProperties":false,"description":"Eligibility result for this page."},"row":{"type":["object","null"],"additionalProperties":{},"description":"Extracted row, or null when no row was produced."},"fields":{"type":["object","null"],"additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["extracted","missing","invalid","low_confidence"],"description":"Extraction status for this field."},"confidence":{"type":["number","null"],"description":"Confidence score for this field."}},"required":["status","confidence"],"additionalProperties":false},"description":"Extraction details for each field."},"extraction":{"type":["object","null"],"properties":{"confidence":{"type":["number","null"],"description":"Overall extraction confidence."},"missing_fields":{"type":"array","items":{"type":"string"},"description":"Schema fields that were not found."}},"required":["confidence","missing_fields"],"additionalProperties":false,"description":"Summary of the extraction result."},"error":{"type":["string","null"],"description":"Error message, or null when no error occurred."}},"required":["url","end_url","eligibility","row","fields","extraction","error"],"additionalProperties":false,"title":"WebDB preview result","description":"Preview result for one URL."},"WebdbsPreviewResponse":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/WebdbsPreviewResult"},"description":"Preview result for each requested URL."},"key_metadata":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"description":"API key usage for this request."}]}},"required":["results"],"additionalProperties":false,"title":"WebDB preview response","description":"Results from testing WebDB extraction."},"WebdbsUsageResponse":{"type":"object","properties":{"credits":{"type":"object","properties":{"balance":{"type":"number","description":"Current organization credit balance."},"consumed_period":{"type":"number","description":"WebDB credits used in the requested period."}},"required":["balance","consumed_period"],"additionalProperties":false,"description":"Credit balance and period usage."},"breakdown_by_collection":{"type":"array","items":{"type":"object","properties":{"collection_id":{"type":"string","example":"col_123","description":"Collection ID."},"name":{"type":"string","description":"Collection name."},"credits":{"type":"number","description":"Credits used by this collection in the requested period."},"rows":{"type":"integer","description":"Current rows in this collection."},"syncs":{"type":"integer","description":"Syncs in the requested period."}},"required":["collection_id","name","credits","rows","syncs"],"additionalProperties":false},"description":"Usage grouped by collection."},"rows_total":{"type":"integer","description":"Current rows across all collections."},"storage_gb":{"type":"number","description":"Snapshot storage used in gigabytes."},"key_metadata":{"allOf":[{"$ref":"#/components/schemas/KeyMetadata"},{"description":"API key usage for this request."}]}},"required":["credits","breakdown_by_collection","rows_total","storage_gb"],"additionalProperties":false,"title":"WebDB usage response","description":"Credit, row, sync, and storage usage for WebDBs."},"BatchSubmitRequest":{"type":"object","properties":{"input":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["scrape"],"description":"Scrape the pages in `data.urls`."},"data":{"oneOf":[{"type":"object","properties":{"format":{"type":"string","enum":["markdown"],"description":"Return page content as Markdown."},"urls":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","minLength":1,"description":"Page URL to scrape.","example":"https://example.com/products/anvil"},"itemId":{"type":"string","minLength":1,"maxLength":200,"description":"Your ID for this page, returned with its result. The same URL can use different IDs.","example":"sku-1"},"meta":{"type":"object","additionalProperties":{},"description":"Custom JSON returned unchanged with this page result."}},"required":["url"],"additionalProperties":false,"description":"A page to scrape, with optional data for matching results."},"minItems":1,"maxItems":25000,"description":"Pages to scrape. Maximum 25000."},"options":{"type":"object","properties":{"includeLinks":{"type":"boolean","default":true,"description":"Include links in the Markdown."},"includeImages":{"type":"boolean","default":false,"description":"Include image references in the Markdown."},"shortenBase64Images":{"type":"boolean","default":true,"description":"Shorten inline base64 image data."},"useMainContentOnly":{"type":"boolean","default":false,"description":"Return the main content without navigation or footers."},"includeHTML":{"type":"boolean","default":false,"description":"Also include each page's HTML in its result record, as an `html` field alongside the Markdown."},"pdf":{"type":"object","properties":{"shouldParse":{"type":"boolean","default":true,"description":"When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and a 400 PDF_SKIPPED is returned."},"start":{"type":"integer","minimum":1,"description":"First 1-based PDF page to parse. When omitted, parsing starts at the first page."},"end":{"type":"integer","minimum":1,"description":"Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided."},"ocr":{"type":"boolean","default":false,"description":"When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs."}},"default":{"shouldParse":true,"ocr":false},"description":"PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range."},"includeSelectors":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":2048},"maxItems":50,"description":"Keep only the subtrees matching these CSS selectors. Filtered pages are always fetched fresh, ignoring `maxAgeMs`."},"excludeSelectors":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":2048},"maxItems":50,"description":"Remove elements matching these CSS selectors. Applied after `includeSelectors`, so an element matching both is removed."},"waitForMs":{"type":"integer","minimum":0,"maximum":15000,"description":"How long to wait after initial page load, in milliseconds. `0` waits 500 ms."},"settleAnimations":{"type":"boolean","default":false,"description":"Wait briefly for CSS and transition animations to settle before extraction, on pages that render in a browser."},"country":{"$ref":"#/components/schemas/BrowserCountryCode"},"maxAgeMs":{"type":["integer","null"],"minimum":0,"maximum":2592000000,"default":86400000,"description":"Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh."}},"default":{"includeLinks":true,"includeImages":false,"shortenBase64Images":true,"useMainContentOnly":false,"includeHTML":false,"pdf":{"shouldParse":true,"ocr":false},"settleAnimations":false,"maxAgeMs":86400000},"additionalProperties":false,"description":"Options for Markdown output."}},"required":["format","urls"],"additionalProperties":false,"description":"Scrape the listed pages as Markdown.","title":"Markdown"},{"type":"object","properties":{"format":{"type":"string","enum":["html"],"description":"Return page content as HTML."},"urls":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","minLength":1,"description":"Page URL to scrape.","example":"https://example.com/products/anvil"},"itemId":{"type":"string","minLength":1,"maxLength":200,"description":"Your ID for this page, returned with its result. The same URL can use different IDs.","example":"sku-1"},"meta":{"type":"object","additionalProperties":{},"description":"Custom JSON returned unchanged with this page result."}},"required":["url"],"additionalProperties":false,"description":"A page to scrape, with optional data for matching results."},"minItems":1,"maxItems":25000,"description":"Pages to scrape. Maximum 25000."},"options":{"type":"object","properties":{"useMainContentOnly":{"type":"boolean","default":false,"description":"Return the main content without navigation or footers."},"pdf":{"type":"object","properties":{"shouldParse":{"type":"boolean","default":true,"description":"When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and a 400 PDF_SKIPPED is returned."},"start":{"type":"integer","minimum":1,"description":"First 1-based PDF page to parse. When omitted, parsing starts at the first page."},"end":{"type":"integer","minimum":1,"description":"Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided."},"ocr":{"type":"boolean","default":false,"description":"When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs."}},"default":{"shouldParse":true,"ocr":false},"description":"PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range."},"includeSelectors":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":2048},"maxItems":50,"description":"Keep only the subtrees matching these CSS selectors. Filtered pages are always fetched fresh, ignoring `maxAgeMs`."},"excludeSelectors":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":2048},"maxItems":50,"description":"Remove elements matching these CSS selectors. Applied after `includeSelectors`, so an element matching both is removed."},"waitForMs":{"type":"integer","minimum":0,"maximum":15000,"description":"How long to wait after initial page load, in milliseconds. `0` waits 500 ms."},"settleAnimations":{"type":"boolean","default":false,"description":"Wait briefly for CSS and transition animations to settle before extraction, on pages that render in a browser."},"country":{"$ref":"#/components/schemas/BrowserCountryCode"},"maxAgeMs":{"type":["integer","null"],"minimum":0,"maximum":2592000000,"default":86400000,"description":"Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh."}},"default":{"useMainContentOnly":false,"pdf":{"shouldParse":true,"ocr":false},"settleAnimations":false,"maxAgeMs":86400000},"additionalProperties":false,"description":"Options for HTML output."}},"required":["format","urls"],"additionalProperties":false,"description":"Scrape the listed pages as HTML.","title":"HTML"}],"discriminator":{"propertyName":"format"},"title":"Scrape data","description":"Pages to scrape and their output format."}},"required":["mode","data"],"additionalProperties":false,"title":"Scrape","description":"Scrape up to 25K URLs in one batch."},{"type":"object","properties":{"mode":{"type":"string","enum":["crawl"],"description":"Discover and scrape pages from `data.source`."},"data":{"oneOf":[{"type":"object","properties":{"format":{"type":"string","enum":["markdown"],"description":"Return page content as Markdown."},"source":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["start_url"],"description":"Start from one page."},"url":{"type":"string","minLength":1,"description":"Page where crawling begins. A URL without a scheme is read as https://.","example":"https://example.com/docs"},"controls":{"type":"object","properties":{"maxUrls":{"type":"integer","minimum":1,"maximum":25000,"default":100,"description":"Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000."},"maxDepth":{"type":"integer","minimum":0,"maximum":50,"description":"Maximum link depth. Source pages are depth 0. No limit when omitted."},"followSubdomains":{"type":"boolean","default":false,"description":"Follow links to subdomains."},"regex":{"type":"string","maxLength":256,"description":"RE2 pattern for URLs to include. The `start_url` itself is always included.","example":"^https://example\\.com/docs/"}},"default":{"maxUrls":100,"followSubdomains":false},"additionalProperties":false,"description":"Limits and filters for page discovery."}},"required":["type","url"],"additionalProperties":false,"description":"Discover pages by following links from one URL.","title":"Start URL"},{"type":"object","properties":{"type":{"type":"string","enum":["sitemap"],"description":"Scrape the URLs in the domain's sitemap."},"domain":{"type":"string","minLength":3,"description":"Domain whose sitemap lists the pages to scrape. A full URL is reduced to its domain.","example":"example.com"},"controls":{"type":"object","properties":{"maxUrls":{"type":"integer","minimum":1,"maximum":25000,"default":100,"description":"Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000."},"regex":{"type":"string","maxLength":256,"description":"RE2 pattern; only sitemap URLs matching it are scraped.","example":"^https://example\\.com/docs/"}},"default":{"maxUrls":100},"additionalProperties":false,"description":"Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those URLs and never follows links off them, so there is no crawl depth here."}},"required":["type","domain"],"additionalProperties":false,"description":"Scrape the pages listed in a domain's sitemap. Links on those pages are not followed.","title":"Sitemap"}],"discriminator":{"propertyName":"type"},"title":"Crawl source","description":"How to find pages to crawl."},"options":{"type":"object","properties":{"includeLinks":{"type":"boolean","default":true,"description":"Include links in the Markdown."},"includeImages":{"type":"boolean","default":false,"description":"Include image references in the Markdown."},"shortenBase64Images":{"type":"boolean","default":true,"description":"Shorten inline base64 image data."},"useMainContentOnly":{"type":"boolean","default":false,"description":"Return the main content without navigation or footers."},"includeHTML":{"type":"boolean","default":false,"description":"Also include each page's HTML in its result record, as an `html` field alongside the Markdown."},"pdf":{"type":"object","properties":{"shouldParse":{"type":"boolean","default":true,"description":"When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and a 400 PDF_SKIPPED is returned."},"start":{"type":"integer","minimum":1,"description":"First 1-based PDF page to parse. When omitted, parsing starts at the first page."},"end":{"type":"integer","minimum":1,"description":"Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided."},"ocr":{"type":"boolean","default":false,"description":"When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs."}},"default":{"shouldParse":true,"ocr":false},"description":"PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range."},"includeSelectors":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":2048},"maxItems":50,"description":"Keep only the subtrees matching these CSS selectors. Filtered pages are always fetched fresh, ignoring `maxAgeMs`."},"excludeSelectors":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":2048},"maxItems":50,"description":"Remove elements matching these CSS selectors. Applied after `includeSelectors`, so an element matching both is removed."},"waitForMs":{"type":"integer","minimum":0,"maximum":15000,"description":"How long to wait after initial page load, in milliseconds. `0` waits 500 ms."},"settleAnimations":{"type":"boolean","default":false,"description":"Wait briefly for CSS and transition animations to settle before extraction, on pages that render in a browser."},"country":{"$ref":"#/components/schemas/BrowserCountryCode"},"maxAgeMs":{"type":["integer","null"],"minimum":0,"maximum":2592000000,"default":86400000,"description":"Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh."}},"default":{"includeLinks":true,"includeImages":false,"shortenBase64Images":true,"useMainContentOnly":false,"includeHTML":false,"pdf":{"shouldParse":true,"ocr":false},"settleAnimations":false,"maxAgeMs":86400000},"additionalProperties":false,"description":"Options for Markdown output."}},"required":["format","source"],"additionalProperties":false,"title":"Markdown","description":"Crawl pages and return Markdown."},{"type":"object","properties":{"format":{"type":"string","enum":["html"],"description":"Return page content as HTML."},"source":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["start_url"],"description":"Start from one page."},"url":{"type":"string","minLength":1,"description":"Page where crawling begins. A URL without a scheme is read as https://.","example":"https://example.com/docs"},"controls":{"type":"object","properties":{"maxUrls":{"type":"integer","minimum":1,"maximum":25000,"default":100,"description":"Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000."},"maxDepth":{"type":"integer","minimum":0,"maximum":50,"description":"Maximum link depth. Source pages are depth 0. No limit when omitted."},"followSubdomains":{"type":"boolean","default":false,"description":"Follow links to subdomains."},"regex":{"type":"string","maxLength":256,"description":"RE2 pattern for URLs to include. The `start_url` itself is always included.","example":"^https://example\\.com/docs/"}},"default":{"maxUrls":100,"followSubdomains":false},"additionalProperties":false,"description":"Limits and filters for page discovery."}},"required":["type","url"],"additionalProperties":false,"description":"Discover pages by following links from one URL.","title":"Start URL"},{"type":"object","properties":{"type":{"type":"string","enum":["sitemap"],"description":"Scrape the URLs in the domain's sitemap."},"domain":{"type":"string","minLength":3,"description":"Domain whose sitemap lists the pages to scrape. A full URL is reduced to its domain.","example":"example.com"},"controls":{"type":"object","properties":{"maxUrls":{"type":"integer","minimum":1,"maximum":25000,"default":100,"description":"Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000."},"regex":{"type":"string","maxLength":256,"description":"RE2 pattern; only sitemap URLs matching it are scraped.","example":"^https://example\\.com/docs/"}},"default":{"maxUrls":100},"additionalProperties":false,"description":"Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those URLs and never follows links off them, so there is no crawl depth here."}},"required":["type","domain"],"additionalProperties":false,"description":"Scrape the pages listed in a domain's sitemap. Links on those pages are not followed.","title":"Sitemap"}],"discriminator":{"propertyName":"type"},"title":"Crawl source","description":"How to find pages to crawl."},"options":{"type":"object","properties":{"useMainContentOnly":{"type":"boolean","default":false,"description":"Return the main content without navigation or footers."},"pdf":{"type":"object","properties":{"shouldParse":{"type":"boolean","default":true,"description":"When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and a 400 PDF_SKIPPED is returned."},"start":{"type":"integer","minimum":1,"description":"First 1-based PDF page to parse. When omitted, parsing starts at the first page."},"end":{"type":"integer","minimum":1,"description":"Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided."},"ocr":{"type":"boolean","default":false,"description":"When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs."}},"default":{"shouldParse":true,"ocr":false},"description":"PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range."},"includeSelectors":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":2048},"maxItems":50,"description":"Keep only the subtrees matching these CSS selectors. Filtered pages are always fetched fresh, ignoring `maxAgeMs`."},"excludeSelectors":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":2048},"maxItems":50,"description":"Remove elements matching these CSS selectors. Applied after `includeSelectors`, so an element matching both is removed."},"waitForMs":{"type":"integer","minimum":0,"maximum":15000,"description":"How long to wait after initial page load, in milliseconds. `0` waits 500 ms."},"settleAnimations":{"type":"boolean","default":false,"description":"Wait briefly for CSS and transition animations to settle before extraction, on pages that render in a browser."},"country":{"$ref":"#/components/schemas/BrowserCountryCode"},"maxAgeMs":{"type":["integer","null"],"minimum":0,"maximum":2592000000,"default":86400000,"description":"Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh."}},"default":{"useMainContentOnly":false,"pdf":{"shouldParse":true,"ocr":false},"settleAnimations":false,"maxAgeMs":86400000},"additionalProperties":false,"description":"Options for HTML output."}},"required":["format","source"],"additionalProperties":false,"title":"HTML","description":"Crawl pages and return HTML."}],"discriminator":{"propertyName":"format"},"title":"Crawl data","description":"Crawl source and output format."}},"required":["mode","data"],"additionalProperties":false,"title":"Crawl","description":"Crawl pages starting from a URL or from a domain's sitemap."}],"discriminator":{"propertyName":"mode"},"title":"Batch input","description":"Choose a URL list or a site crawl."},"webhookUrl":{"type":"string","description":"URL notified when the batch finishes."},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20,"description":"Tags stored on the batch. Filter the batch list by them later.","example":["docs","competitor"]}},"required":["input"],"title":"Submit batch request","description":"Create an asynchronous scraping job."},"BatchPageErrorCount":{"type":"object","properties":{"code":{"type":"string","example":"WEBSITE_ACCESS_ERROR","description":"Error code for these failures."},"count":{"type":"integer","example":204,"description":"Pages that failed with this code."}},"required":["code","count"],"x-stainless-model":"batch.page_error_count","description":"Page failures sharing one error code."},"BatchFailure":{"type":"object","properties":{"code":{"type":"string","example":"stalled","description":"Why the batch itself stopped."},"message":{"type":"string","example":"Batch stopped reporting progress and was finalized automatically","description":"Human-readable explanation."}},"required":["code","message"],"x-stainless-model":"batch.failure","description":"A failure of the batch as a whole, distinct from the per-page failures in `page_errors`."},"BatchNullableFailure":{"anyOf":[{"allOf":[{"$ref":"#/components/schemas/BatchFailure"}]},{"type":"null"}],"description":"Why the batch as a whole stopped. Null unless `status` is `failed`. Individual pages that failed are counted in `page_errors` instead."},"BatchCrawlControls":{"type":"object","properties":{"source":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["start_url"]},"url":{"type":"string","example":"https://example.com/docs","description":"Page the crawl started from."}},"required":["type","url"],"title":"Start URL","description":"The crawl discovered pages by following links from one URL."},{"type":"object","properties":{"type":{"type":"string","enum":["sitemap"]},"domain":{"type":"string","example":"example.com","description":"Domain whose sitemap supplied the pages."}},"required":["type","domain"],"title":"Sitemap","description":"The crawl scraped the pages listed in the domain's sitemap."}],"description":"Where the crawl started."},"max_pages":{"type":"integer","example":500,"description":"The `maxUrls` submitted with the crawl. A sitemap crawl scrapes only the URLs its sitemap actually lists, up to this many, so `input.reserved` is often lower."},"max_depth":{"type":["integer","null"],"example":0,"description":"Link depth limit. Always 0 for a sitemap crawl, which never follows links off its URLs; null when a `start_url` crawl set no limit."},"follow_subdomains":{"type":"boolean","description":"Whether links to subdomains were followed. Always false for a sitemap crawl."},"url_pattern":{"type":["string","null"],"example":"^https://example\\.com/docs/","description":"RE2 pattern URLs had to match to be crawled. Null when the crawl set none."}},"required":["source","max_pages","max_depth","follow_subdomains","url_pattern"],"x-stainless-model":"batch.crawl_controls","title":"Crawl controls","description":"The crawl controls as submitted, so the limits requested can be compared against what the crawl reached."},"BatchNullableCrawlControls":{"anyOf":[{"allOf":[{"$ref":"#/components/schemas/BatchCrawlControls"}]},{"type":"null"}],"description":"How the crawl was configured. Null for scrape batches."},"BatchIntake":{"type":"object","properties":{"reserved":{"type":"integer","example":24817,"description":"Pages credits were reserved for. Everything else — progress, the refund, the completion percentage — is measured against this."},"reserved_is_ceiling":{"type":"boolean","example":false,"description":"Whether `reserved` is an upper bound the batch may finish under. True only for a crawl that follows links, whose reachable page count is unknowable until it runs. False for a scrape and for a sitemap crawl, where `reserved` is an exact page count."},"submitted":{"type":["integer","null"],"example":25000,"description":"URLs in the list you sent, before validation and de-duplication. Null for a crawl, which is given a source rather than a list."},"duplicates":{"type":"integer","example":183,"description":"URLs dropped before reserving because another entry resolved to the same page. Non-zero for sitemap crawls too, whose sitemaps routinely list a page more than once."},"invalid":{"type":["integer","null"],"example":0,"description":"URLs from your list rejected as unusable; the same ones are itemised in `invalid_urls` at submission. Null for a crawl — a crawl that resolves no usable page is rejected outright with a 400 rather than accepted with an empty list."}},"required":["reserved","reserved_is_ceiling","submitted","duplicates","invalid"],"x-stainless-model":"batch.intake","description":"What submission took in, and what it charged for."},"Batch":{"type":"object","properties":{"id":{"type":"string","example":"batch_9f2c8a","description":"Batch ID used to retrieve or cancel the job."},"status":{"type":"string","enum":["queued","running","cancelling","completed","cancelled","failed"],"description":"Current state. `completed`, `cancelled`, and `failed` are final."},"mode":{"type":"string","enum":["scrape","crawl"],"description":"How pages were selected. Matches `input.mode` on the submit request."},"format":{"type":"string","enum":["markdown","html"],"description":"What each page is returned as. Matches `input.data.format` on the submit request."},"tags":{"type":"array","items":{"type":"string"},"description":"Tags stored on the batch at submission.","example":["docs"]},"crawl":{"$ref":"#/components/schemas/BatchNullableCrawlControls"},"input":{"$ref":"#/components/schemas/BatchIntake"},"progress":{"type":"object","properties":{"succeeded":{"type":"integer","example":18091,"description":"Pages scraped successfully."},"failed":{"type":"integer","example":311,"description":"Pages that could not be scraped."},"pending":{"type":"integer","example":6415,"description":"Reserved pages not yet attempted. A cancelled batch keeps reporting the URLs it never reached; a crawl whose `input.reserved_is_ceiling` is true reports 0 once final, because its unspent budget was never real pages."}},"required":["succeeded","failed","pending"],"description":"Pages attempted so far. Use `status` to check completion."},"credits":{"type":"object","properties":{"reserved":{"type":"integer","example":24817,"description":"Credits debited from your balance the moment the batch was accepted. This is a charge, not a forecast — the whole amount leaves the balance up front."},"refunded":{"type":"integer","example":6726,"description":"Credits returned for pages that did not succeed. Stays 0 until the batch reaches a final status, then settles in one movement."},"ocr_charged":{"type":"integer","example":42,"description":"Credits charged for PDF pages recovered by OCR (pdf.ocr=true), 1 per recovered page, on top of `reserved`. Stays 0 until the batch settles."},"net":{"type":"integer","example":18091,"description":"`reserved` minus `refunded` plus `ocr_charged` — what the batch has cost so far. Equal to `reserved` until the batch settles."}},"required":["reserved","refunded","ocr_charged","net"],"description":"What this batch has done to your credit balance."},"timing":{"type":"object","properties":{"created_at":{"type":"string","description":"When the batch was created."},"started_at":{"type":["string","null"],"description":"When processing started. Null while queued."},"completed_at":{"type":["string","null"],"description":"When processing finished. Null while active."}},"required":["created_at","started_at","completed_at"]},"page_errors":{"type":"array","items":{"$ref":"#/components/schemas/BatchPageErrorCount"},"description":"Individual page failures grouped by error code, sorted by count. Unrelated to `failure`, which is the batch itself failing."},"failure":{"$ref":"#/components/schemas/BatchNullableFailure"},"results":{"type":["object","null"],"properties":{"expires_at":{"type":"string","description":"When the download URLs expire."},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Temporary URL for a gzipped NDJSON file."},"items":{"type":"integer","description":"Results in this file."},"bytes":{"type":"integer","description":"Compressed file size in bytes."}},"required":["url","items","bytes"]},"description":"Result files. Order is not guaranteed."}},"required":["expires_at","files"],"description":"Download links, available once the batch reaches a final status and null before then. GET /batch/{batch_id}/results serves the same records as paginated JSON."}},"required":["id","status","mode","format","tags","crawl","input","progress","credits","timing","page_errors","failure","results"],"title":"Batch","description":"An asynchronous web scraping job."},"BatchDetail":{"type":"object","properties":{"invalid_urls":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Rejected URL."},"reason":{"type":"string","description":"Why it was rejected.","example":"Must be a public http:// or https:// URL"}},"required":["url","reason"]},"description":"Rejected URLs, up to 100. These are not charged."}},"required":["invalid_urls"],"title":"Batch detail","description":"What a single-batch read adds to the batch itself."},"BatchCancelling":{"type":"object","properties":{"id":{"type":"string","example":"batch_9f2c8a","description":"Batch ID."},"status":{"type":"string","enum":["cancelling"],"description":"Always `cancelling`. Work already in flight finishes; the batch reaches `cancelled` shortly after."},"mode":{"type":"string","enum":["scrape","crawl"],"description":"How pages were selected."},"format":{"type":"string","enum":["markdown","html"],"description":"What each page is returned as."},"tags":{"type":"array","items":{"type":"string"},"description":"Tags stored on the batch at submission.","example":["docs"]},"crawl":{"$ref":"#/components/schemas/BatchNullableCrawlControls"},"input":{"$ref":"#/components/schemas/BatchIntake"},"progress":{"type":"object","properties":{"succeeded":{"type":"integer","example":4120,"description":"Pages scraped successfully before the request landed."},"failed":{"type":"integer","example":37,"description":"Pages that could not be scraped before the request landed."},"pending":{"type":"integer","example":20660,"description":"Reserved pages that will now be skipped, and refunded when the batch settles."}},"required":["succeeded","failed","pending"],"description":"How far the batch got before cancellation."},"credits":{"type":"object","properties":{"reserved":{"type":"integer","example":24817,"description":"Credits debited at submission. The unspent remainder is refunded once the batch settles — read `credits.refunded` from GET /batch/{batch_id} then."}},"required":["reserved"],"description":"What this batch cost so far."},"timing":{"type":"object","properties":{"created_at":{"type":"string","description":"When the batch was created."},"started_at":{"type":["string","null"],"description":"When processing started. Null if it was cancelled while still queued."}},"required":["created_at","started_at"],"description":"There is no finish time yet — the batch is still winding down."},"page_errors":{"type":"array","items":{"$ref":"#/components/schemas/BatchPageErrorCount"},"description":"Page failures so far, grouped by error code and sorted by count."}},"required":["id","status","mode","format","tags","crawl","input","progress","credits","timing","page_errors"],"title":"Cancelling batch","description":"Acknowledgement that cancellation was requested. The batch has not settled, so it carries no results, no failure, no refund and no finish time; poll GET /batch/{batch_id} for those."},"BatchAccepted":{"type":"object","properties":{"id":{"type":"string","example":"batch_9f2c8a","description":"Batch ID. Poll GET /batch/{batch_id} with it."},"status":{"type":"string","enum":["queued"],"description":"Always `queued`. An accepted batch has not started yet."},"mode":{"type":"string","enum":["scrape","crawl"],"description":"How pages will be selected."},"format":{"type":"string","enum":["markdown","html"],"description":"What each page will be returned as."},"tags":{"type":"array","items":{"type":"string"},"description":"Tags stored on the batch.","example":["docs"]},"crawl":{"$ref":"#/components/schemas/BatchNullableCrawlControls"},"input":{"$ref":"#/components/schemas/BatchIntake"},"credits":{"type":"object","properties":{"reserved":{"type":"integer","example":24817,"description":"Credits just debited from your balance. Whatever the batch does not spend is refunded when it settles."}},"required":["reserved"],"description":"What accepting this batch cost."},"created_at":{"type":"string","description":"When the batch was created."},"invalid_urls":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Rejected URL."},"reason":{"type":"string","description":"Why it was rejected.","example":"Must be a public http:// or https:// URL"}},"required":["url","reason"]},"description":"Rejected URLs, up to 100. These are not charged."},"webhook_secret":{"type":"string","description":"Signing secret for the completion webhook, returned only here and never again. Store it now; it is not repeated by GET /batch/{batch_id}."}},"required":["id","status","mode","format","tags","crawl","input","credits","created_at","invalid_urls"],"title":"Accepted batch","description":"The BatchAccepted schema."},"BatchSettledWebhookPayload":{"type":"object","properties":{"event":{"type":"string","enum":["batch.completed","batch.cancelled","batch.failed"],"description":"Which final status the batch reached. Mirrors the `X-Context-Event` header."},"id":{"type":"string","example":"evt_123","description":"Unique event ID. Mirrors the `X-Context-Id` header."},"created_at":{"type":"string","format":"date-time","example":"2026-07-09T18:00:12.000Z","description":"When the delivery was generated."},"data":{"type":"object","properties":{"batch":{"allOf":[{"$ref":"#/components/schemas/Batch"}],"description":"The settled batch, identical to the body of GET /batch/{batch_id} minus `invalid_urls`. Its `results` carry download links that expire, so fetch them promptly or re-read the batch."}},"required":["batch"]}},"required":["event","id","created_at","data"],"title":"Batch settled webhook payload","description":"Payload sent when a batch reaches a final status."},"BatchResultRecord":{"oneOf":[{"type":"object","properties":{"url":{"type":"string","example":"https://example.com/products/anvil","description":"URL as submitted, or as discovered by the crawl."},"itemId":{"type":"string","example":"sku-1","description":"Caller-supplied identifier echoed from submission."},"meta":{"type":"object","additionalProperties":{},"description":"Caller-supplied metadata echoed from submission."},"status":{"type":"string","enum":["ok"],"description":"The page was scraped."},"http_status":{"type":["integer","null"],"example":200,"description":"HTTP status of the final response, when known."},"final_url":{"type":"string","description":"URL the content was read from, after redirects."},"markdown":{"type":"string","description":"Page content as Markdown. Present on markdown batches."},"html":{"type":"string","description":"Page HTML. Present on html batches, and on markdown batches submitted with `options.includeHTML`."},"metadata":{"$ref":"#/components/schemas/PageMetadata"},"ocr_pages":{"type":"integer","example":3,"description":"PDF pages of this document recovered by OCR (pdf.ocr=true). Each recovered page bills 1 credit on top of the page base credit; absent when no OCR ran."}},"required":["url","status","http_status","final_url","metadata"],"title":"Scraped page","description":"A page the batch fetched successfully."},{"type":"object","properties":{"url":{"type":"string","example":"https://example.com/products/anvil","description":"URL as submitted, or as discovered by the crawl."},"itemId":{"type":"string","example":"sku-1","description":"Caller-supplied identifier echoed from submission."},"meta":{"type":"object","additionalProperties":{},"description":"Caller-supplied metadata echoed from submission."},"status":{"type":"string","enum":["error"],"description":"The page could not be scraped."},"error_code":{"type":"string","example":"NOT_FOUND","description":"Why the page failed."},"message":{"type":"string","example":"Page returned 404","description":"Human-readable failure detail."}},"required":["url","status","error_code","message"],"title":"Failed page","description":"A page the batch could not fetch."}],"discriminator":{"propertyName":"status"},"title":"Batch result record","description":"One page outcome from a finished batch."},"NewsSearchEntityByName":{"type":"object","properties":{"type":{"type":"string","enum":["name"]},"name":{"type":"string","minLength":2,"maxLength":200,"description":"Company name."}},"required":["type","name"],"additionalProperties":false,"description":"Identify the company by name.","title":"By Name"},"NewsSearchEntityByDomain":{"type":"object","properties":{"type":{"type":"string","enum":["domain"]},"domain":{"type":"string","minLength":1,"maxLength":253,"description":"Company website domain, such as apple.com."}},"required":["type","domain"],"additionalProperties":false,"description":"Identify the company by website domain.","title":"By Domain"},"NewsSearchEntityByTicker":{"type":"object","properties":{"type":{"type":"string","enum":["ticker"]},"ticker":{"type":"string","minLength":1,"maxLength":20,"pattern":"^[A-Za-z0-9.-]+$","description":"Public-company ticker."},"exchange":{"type":"string","enum":["AMEX","AMS","AQS","ASX","ATH","BER","BME","BRU","BSE","BUD","BUE","BVC","CBOE","CNQ","CPH","DFM","DOH","DUB","DUS","DXE","EGX","FSX","HAM","HEL","HKSE","HOSE","ICE","IOB","IST","JKT","JNB","JPX","KLS","KOE","KSC","KUW","LIS","LSE","MCX","MEX","MIL","MUN","NASDAQ","NEO","NSE","NYSE","NZE","OSL","OTC","PAR","PNK","PRA","RIS","SAO","SAU","SES","SET","SGO","SHH","SHZ","SIX","STO","STU","TAI","TAL","TLV","TSX","TSXV","TWO","VIE","WSE","XETRA"],"description":"Stock exchange the ticker trades on, used to disambiguate tickers listed on multiple exchanges."}},"required":["type","ticker"],"additionalProperties":false,"description":"Identify the company by stock ticker, optionally scoped to an exchange.","title":"By Ticker"},"NewsSearchEntityByIsin":{"type":"object","properties":{"type":{"type":"string","enum":["isin"]},"isin":{"type":"string","pattern":"^[A-Za-z]{2}[A-Za-z0-9]{9}[0-9]$","description":"International Securities Identification Number."}},"required":["type","isin"],"additionalProperties":false,"description":"Identify the company by International Securities Identification Number.","title":"By ISIN"},"WebScrapeAction":{"oneOf":[{"$ref":"#/components/schemas/WebScrapeWaitAction"},{"$ref":"#/components/schemas/WebScrapePerformAction"},{"$ref":"#/components/schemas/WebScrapeScrollAction"}],"discriminator":{"propertyName":"do","mapping":{"wait":"#/components/schemas/WebScrapeWaitAction","perform":"#/components/schemas/WebScrapePerformAction","scroll":"#/components/schemas/WebScrapeScrollAction"}},"description":"Browser action discriminated by `do`. Each variant exposes only its applicable fields."},"WebScrapeWaitAction":{"type":"object","properties":{"do":{"type":"string","enum":["wait"]},"timeMs":{"type":"integer","minimum":0,"maximum":30000}},"required":["do","timeMs"],"additionalProperties":false,"description":"Pause for a fixed number of milliseconds before continuing to the next action.","title":"Wait"},"WebScrapePerformAction":{"type":"object","properties":{"do":{"type":"string","enum":["perform"]},"action":{"type":"string","minLength":1,"maxLength":500}},"required":["do","action"],"additionalProperties":false,"description":"Resolve and perform one natural-language browser action.","title":"Perform"},"WebScrapeScrollAction":{"type":"object","properties":{"do":{"type":"string","enum":["scroll"]},"direction":{"type":"string","enum":["up","down","left","right"],"description":"Direction to scroll. Defaults to down."},"amount":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"string","enum":["viewport","max"]}],"description":"Pixels per scroll, one visible viewport, or the current scroll boundary. Defaults to viewport."},"container":{"type":"string","minLength":1,"maxLength":2000,"description":"CSS selector for the first matching scroll container. Defaults to the page."},"maxScrolls":{"type":"integer","minimum":1,"maximum":50,"description":"Maximum scroll iterations. Stops early when scrolling and scrollable extent stop changing. Defaults to 1."}},"required":["do"],"additionalProperties":false,"description":"Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.","title":"Scroll"},"StockExchange":{"type":"string","enum":["AMEX","AMS","AQS","ASX","ATH","BER","BME","BRU","BSE","BUD","BUE","BVC","CBOE","CNQ","CPH","DFM","DOH","DUB","DUS","DXE","EGX","FSX","HAM","HEL","HKSE","HOSE","ICE","IOB","IST","JKT","JNB","JPX","KLS","KOE","KSC","KUW","LIS","LSE","MCX","MEX","MIL","MUN","NASDAQ","NEO","NSE","NYSE","NZE","OSL","OTC","PAR","PNK","PRA","RIS","SAO","SAU","SES","SET","SGO","SHH","SHZ","SIX","STO","STU","TAI","TAL","TLV","TSX","TSXV","TWO","VIE","WSE","XETRA"],"description":"Stock exchange code."},"CountryGL":{"type":"string","enum":["af","al","dz","as","ad","ao","ai","aq","ag","ar","am","aw","au","at","az","bs","bh","bd","bb","by","be","bz","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","ky","cf","td","cl","cn","cx","cc","co","km","cg","cd","ck","cr","ci","hr","cu","cy","cz","dk","dj","dm","do","ec","eg","sv","gq","er","ee","et","fk","fo","fj","fi","fr","gf","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gd","gp","gu","gt","gn","gw","gy","ht","hm","va","hn","hk","hu","is","in","id","ir","iq","ie","il","it","jm","jp","jo","kz","ke","ki","kp","kr","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mq","mr","mu","yt","mx","fm","md","mc","mn","ms","ma","mz","mm","na","nr","np","nl","an","nc","nz","ni","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pa","pg","py","pe","ph","pn","pl","pt","pr","qa","re","ro","ru","rw","sh","kn","lc","pm","vc","ws","sm","st","sa","sn","rs","sc","sl","sg","sk","si","sb","so","za","gs","es","lk","sd","sr","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tt","tn","tr","tm","tc","tv","ug","ua","ae","gb","us","um","uy","uz","vu","ve","vn","vg","vi","wf","eh","ye","zm","zw"],"description":"Two-letter ISO 3166-1 alpha-2 country code (GL parameter) used to localize search."}}},"paths":{"/news/search":{"post":{"summary":"Search company news","description":"Searches live and historical company news for one company, identified in searchBy by name, domain, ticker (optionally disambiguated by exchange), or ISIN. Results can be filtered by publisher domain, publisher country, article language, article type, and published-at date, and include stable story IDs, source metadata, verified entity relevance, and cursor pagination.","tags":["News"],"x-mint":{"content":"<Badge color=\"blue\">1 Credit Per 10 Results</Badge>"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"searchBy":{"type":"object","properties":{"type":{"type":"string","enum":["entity"],"description":"How to search. Only entity search is supported."},"entity":{"oneOf":[{"$ref":"#/components/schemas/NewsSearchEntityByName"},{"$ref":"#/components/schemas/NewsSearchEntityByDomain"},{"$ref":"#/components/schemas/NewsSearchEntityByTicker"},{"$ref":"#/components/schemas/NewsSearchEntityByIsin"}],"discriminator":{"propertyName":"type","mapping":{"name":"#/components/schemas/NewsSearchEntityByName","domain":"#/components/schemas/NewsSearchEntityByDomain","ticker":"#/components/schemas/NewsSearchEntityByTicker","isin":"#/components/schemas/NewsSearchEntityByIsin"}},"description":"The company to search news for, identified by name, domain, ticker, or ISIN."}},"required":["type","entity"],"additionalProperties":false,"description":"What to search for."},"filterBy":{"type":"object","properties":{"sourceDomain":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"minItems":1,"maxItems":3,"description":"Publisher domains to include. Up to 3."},"sourceCountry":{"type":"array","items":{"type":"string","enum":["ae","ar","au","ca","cg","ch","cl","cz","de","fi","fr","gb","hk","il","in","jp","kr","mx","ng","nl","qa","sa","se","sg","us","za"]},"minItems":1,"maxItems":3,"description":"Publisher countries to include, as lowercase ISO 3166-1 alpha-2 codes. Up to 3."},"articleLanguage":{"type":"array","items":{"type":"string","enum":["ar","de","en","es","fr","hi","it","ja","ko","nl","pt","ru","zh"]},"minItems":1,"maxItems":3,"description":"Article languages to include. Up to 3."},"articleType":{"type":"array","items":{"type":"string","enum":["editorial","press_release","regulatory_filing","advisory"]},"minItems":1,"maxItems":3,"description":"Article types to include. Up to 3."},"date":{"type":"object","properties":{"from":{"type":"integer","description":"Inclusive start of the published-at window, in epoch milliseconds."},"to":{"type":"integer","description":"Inclusive end of the published-at window, in epoch milliseconds."}},"additionalProperties":false,"description":"Published-at window in epoch milliseconds."}},"default":{},"additionalProperties":false,"description":"Optional result filters."},"sortBy":{"type":"object","properties":{"type":{"type":"string","enum":["relevance","newest"],"description":"Result ordering."}},"default":{"type":"newest"},"required":["type"],"additionalProperties":false,"description":"Result ordering. Defaults to newest."},"limit":{"type":"integer","minimum":1,"maximum":100,"default":10,"description":"Maximum results to return. Defaults to 10."},"cursor":{"type":["string","null"],"maxLength":300,"description":"Opaque next_cursor from the previous response, or null for the first page."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["searchBy"],"additionalProperties":false}}}},"responses":{"200":{"description":"Company news results","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":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Stable unique identifier for this article. Use it to deduplicate or reference an article across requests."},"story_id":{"type":"string","description":"Shared by articles covering the same story on the same day. Use it to group or collapse syndicated copies of one announcement across outlets."},"url":{"type":"string","format":"uri","description":"Link to the article on the publisher site."},"title":{"type":"string","description":"Article headline."},"description":{"type":["string","null"],"description":"Short summary or excerpt of the article, when the publisher provides one."},"language":{"type":["string","null"],"description":"Language the article is written in, as a lowercase ISO 639-1 code such as en. Null when unknown."},"authors":{"type":"array","items":{"type":"string"},"description":"Bylined authors. Empty when no byline is available."},"image_url":{"type":["string","null"],"description":"Lead image for the article, when one is available."},"published_at":{"type":["string","null"],"format":"date-time","description":"When the article was published, as an ISO 8601 timestamp. Null when the publisher does not state a reliable date."},"type":{"type":"string","enum":["editorial","press_release","regulatory_filing","advisory"],"description":"Kind of coverage. Use it to separate independent reporting (editorial) from company-issued content (press_release, regulatory_filing, advisory)."},"source":{"type":"object","properties":{"name":{"type":"string","description":"Name of the publication, such as Reuters."},"domain":{"type":"string","description":"Website domain of the publication."},"direct":{"type":"boolean","description":"True when Context observed this article in the publisher-owned feed."}},"required":["name","domain","direct"],"description":"The publication that published the article."},"match":{"type":"object","properties":{"level":{"type":"string","enum":["primary","secondary"],"description":"primary when the article is mainly about the company, secondary when the company is mentioned but is not the main subject."},"confidence":{"type":["number","null"],"minimum":0,"maximum":1,"description":"How confident the match is, from 0 to 1. Null when a score is unavailable."}},"required":["level","confidence"],"description":"How the article relates to the company you searched for."}},"required":["id","story_id","url","title","description","language","authors","image_url","published_at","type","source","match"]},"description":"Articles matching the search, in the requested order."},"has_more":{"type":"boolean","description":"True when more results are available beyond this page."},"next_cursor":{"type":["string","null"],"description":"Pass as cursor in the next request to fetch the following page. Null when there are no more results."},"meta":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"description":"Number of articles in this page."}},"required":["count"],"description":"Summary information about this response."},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["data","has_more","next_cursor","meta"]}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."},"429":{"description":"Request exceeded the applicable rate limit.","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"}}}},"500":{"description":"News search failed because the index or an upstream resolver was unavailable.","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.news.search({\n  searchBy: {\n    entity: { name: 'xx', type: 'name' },\n    type: 'entity',\n  },\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.news.search(\n    search_by={\n        \"entity\": {\n            \"name\": \"xx\",\n            \"type\": \"name\",\n        },\n        \"type\": \"entity\",\n    },\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.News.Search(context.TODO(), contextdev.NewsSearchParams{\n\t\tSearchBy: contextdev.NewsSearchParamsSearchBy{\n\t\t\tEntity: contextdev.NewsSearchParamsSearchByEntityUnion{\n\t\t\t\tOfName: &contextdev.NewsSearchParamsSearchByEntityName{\n\t\t\t\t\tName: \"xx\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tType: \"entity\",\n\t\t},\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.news.search(search_by: {entity: {name: \"xx\", type: :name}, type: :entity})\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->news->search(\n    searchBy: [\n      'entity' => ['name' => 'xx', 'type' => 'name'], 'type' => 'entity'\n    ],\n    cursor: 'cursor',\n    filterBy: [\n      'articleLanguage' => ['ar'],\n      'articleType' => ['editorial'],\n      'date' => ['from' => 0, 'to' => 0],\n      'sourceCountry' => ['ae'],\n      'sourceDomain' => ['x'],\n    ],\n    limit: 1,\n    sortBy: ['type' => 'relevance'],\n    tags: ['production', 'team-alpha'],\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev news search \\\n  --api-key 'My API Key' \\\n  --search-by '{entity: {name: xx, type: name}, type: entity}'"}],"operationId":"post_news_search"}},"/parse":{"post":{"summary":"Parse Bytes","description":"Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes into LLM-usable Markdown.","requestBody":{"required":true,"description":"Raw file bytes. The request body must not exceed 25 MiB.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"*/*":{"schema":{"type":"string","format":"binary"}}}},"security":[{"bearerAuth":[]}],"tags":["Parsing"],"x-mint":{"content":"<Badge color=\"blue\">1 Credit</Badge>","title":"Parse Bytes","sidebarTitle":"Parse Bytes","description":"Convert raw document bytes into Markdown"},"parameters":[{"schema":{"type":"string","enum":["txt","text","md","markdown","html","htm","xhtml","xml","rss","atom","csv","tsv","yaml","yml","py","java","js","jsx","mjs","cjs","json","jsonl","ndjson","php","sh","bash","zsh","fish","rb","ts","tsx","rtf","srt","css","scss","less","styl","sass","svg","pdf","docx","doc","xlsx","xlsm","xlsb","xltx","xltm","xls","pptx","pptm","ppsx","ppsm","potx","potm","ppt","pps","pot","jpg","jpeg","jpe","png","gif","bmp","tiff","tif","webp","ppm","pbm","pgm","pnm"],"description":"Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, or txt."},"required":false,"description":"Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, or txt.","name":"extension","in":"query"},{"schema":{"type":"boolean","default":true,"description":"Preserve hyperlinks in Markdown output"},"required":false,"description":"Preserve hyperlinks in Markdown output","name":"includeLinks","in":"query"},{"schema":{"type":"boolean","default":false,"description":"Include image references in Markdown output"},"required":false,"description":"Include image references in Markdown output","name":"includeImages","in":"query"},{"schema":{"type":"boolean","default":true,"description":"Shorten base64-encoded image data in the Markdown output"},"required":false,"description":"Shorten base64-encoded image data in the Markdown output","name":"shortenBase64Images","in":"query"},{"schema":{"type":"boolean","default":false,"description":"Extract only the main content from HTML-like inputs"},"required":false,"description":"Extract only the main content from HTML-like inputs","name":"useMainContentOnly","in":"query"},{"schema":{"type":"boolean","default":false,"description":"When true for PDF inputs, OCR the selected pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. pdf.start/pdf.end limit the inclusive page range. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs."},"required":false,"description":"When true for PDF inputs, OCR the selected pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. pdf.start/pdf.end limit the inclusive page range. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs.","name":"ocr","in":"query"},{"schema":{"type":"object","properties":{"start":{"type":"integer","minimum":1,"description":"First 1-based PDF page to parse. When omitted, parsing starts at the first page."},"end":{"type":"integer","minimum":1,"description":"Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided."}},"default":{},"additionalProperties":false,"description":"PDF page-range options as a JSON object, e.g. {\"start\": 2, \"end\": 5}."},"required":false,"description":"PDF page-range options as a JSON object, e.g. {\"start\": 2, \"end\": 5}.","name":"pdf","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"Optional client identifier used for usage attribution."},"required":false,"description":"Optional client identifier used for usage attribution.","name":"client","in":"query"},{"schema":{"type":"string","enum":["enabled","disabled"],"default":"disabled","description":"Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true."},"required":false,"description":"Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.","name":"zdr","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"},"X-Context-ZDR":{"description":"Present with the value true when zero data retention was requested and honored.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates success"},"markdown":{"type":"string","description":"Input bytes converted to GitHub Flavored Markdown"},"type":{"type":"string","enum":["html","xml","json","jsonl","text","csv","tsv","markdown","yaml","python","java","javascript","php","shell","ruby","typescript","rtf","srt","css","scss","less","stylus","sass","svg","pdf","docx","doc","xlsx","xls","pptx","ppt","jpg","png","gif","bmp","tiff","webp","ppm","pbm","pgm","pnm"],"description":"Detected content type used for parsing"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["success","markdown","type"]}}}},"400":{"description":"Invalid input or no parseable content","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"}}}}}},"413":{"description":"Request body exceeds the 25 MiB upload limit","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"]}}}}}},"415":{"description":"Unsupported content type","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":["UNSUPPORTED_CONTENT"]},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}}}}}},"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"},"error_code":{"type":"string","enum":["INTERNAL_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.parse.handle(fs.createReadStream('path/to/file'));\n\nconsole.log(response.markdown);"},{"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.parse.handle(\n    body=b\"Example data\",\n)\nprint(response.markdown)"},{"lang":"Go","source":"package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\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.Parse.Handle(\n\t\tcontext.TODO(),\n\t\tio.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\tcontextdev.ParseHandleParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Markdown)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.parse.handle(body: StringIO.new(\"Example data\"))\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\FileParam;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->parse->handle(\n    FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev parse handle \\\n  --api-key 'My API Key' \\\n  --body 'Example data'"}],"operationId":"post_parse"}},"/web/scrape/html":{"get":{"summary":"Scrape HTML","description":"Scrapes the given URL and returns the raw HTML content of the page. The base request costs 1 credit; requests with browser actions cost 2 credits.","security":[{"bearerAuth":[]}],"tags":["Web Scraping"],"x-mint":{"content":"<Badge color=\"blue\">1 Credit</Badge><Badge color=\"orange\">With actions: 2 Credits</Badge>","title":"Scrape HTML","sidebarTitle":"Scrape HTML","description":"Scrape the raw HTML from a URL"},"parameters":[{"schema":{"type":"string","minLength":1,"format":"uri","description":"Full URL to scrape (must include http:// or https:// protocol)"},"required":true,"description":"Full URL to scrape (must include http:// or https:// protocol)","name":"url","in":"query"},{"schema":{"type":"object","properties":{"shouldParse":{"type":"boolean","default":true,"description":"When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and a 400 PDF_SKIPPED is returned."},"start":{"type":"integer","minimum":1,"description":"First 1-based PDF page to parse. When omitted, parsing starts at the first page."},"end":{"type":"integer","minimum":1,"description":"Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided."},"ocr":{"type":"boolean","default":false,"description":"When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs."}},"default":{"shouldParse":true,"ocr":false},"description":"PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range."},"required":false,"description":"PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.","name":"pdf","in":"query"},{"schema":{"type":"boolean","default":false,"description":"When true, iframes are rendered inline into the returned HTML."},"required":false,"description":"When true, iframes are rendered inline into the returned HTML.","name":"includeFrames","in":"query"},{"schema":{"type":"boolean","default":false,"description":"When true, return only the page's main content in the HTML response, excluding headers, footers, sidebars, and navigation when detectable."},"required":false,"description":"When true, return only the page's main content in the HTML response, excluding headers, footers, sidebars, and navigation when detectable.","name":"useMainContentOnly","in":"query"},{"schema":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":2048},"maxItems":50,"description":"CSS selectors. When provided, only matching subtrees (and their descendants) are kept and everything else is dropped. When omitted, the entire document is kept. Examples: \"article.main\", \"#content\", \"[role=main]\"."},"required":false,"description":"CSS selectors. When provided, only matching subtrees (and their descendants) are kept and everything else is dropped. When omitted, the entire document is kept. Examples: \"article.main\", \"#content\", \"[role=main]\".","name":"includeSelectors","in":"query"},{"schema":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":2048},"maxItems":50,"description":"CSS selectors to remove from the result. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: \"nav\", \"footer\", \".ad-banner\", \"[aria-hidden=true]\"."},"required":false,"description":"CSS selectors to remove from the result. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: \"nav\", \"footer\", \".ad-banner\", \"[aria-hidden=true]\".","name":"excludeSelectors","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":2592000000,"default":86400000,"description":"Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh."},"required":false,"description":"Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.","name":"maxAgeMs","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":30000,"description":"Optional browser wait time in milliseconds after initial page load. Min: 0. Max: 30000 (30 seconds)."},"required":false,"description":"Optional browser wait time in milliseconds after initial page load. Min: 0. Max: 30000 (30 seconds).","name":"waitForMs","in":"query"},{"schema":{"type":"boolean","default":false,"description":"When true, waits briefly for CSS and transition animations to settle before extracting HTML. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages."},"required":false,"description":"When true, waits briefly for CSS and transition animations to settle before extracting HTML. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.","name":"settleAnimations","in":"query"},{"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/WebScrapeAction"},"maxItems":5,"description":"Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions."},"required":false,"description":"Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions.","name":"actions","in":"query"},{"schema":{"type":"object","additionalProperties":{"type":"string","maxLength":8192,"pattern":"^[^\\r\\n]*$"},"description":"Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache."},"required":false,"description":"Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.","name":"headers","in":"query"},{"schema":{"$ref":"#/components/schemas/BrowserCountryCode"},"required":false,"description":"Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).","name":"country","in":"query"},{"schema":{"$ref":"#/components/schemas/LenientTimeoutMS"},"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":["enabled","disabled"],"default":"disabled","description":"Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true."},"required":false,"description":"Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.","name":"zdr","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"},"X-Context-ZDR":{"description":"Present with the value true when zero data retention was requested and honored.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates success"},"html":{"type":"string","description":"The scraped content of the page. For normal pages this is the raw HTML. When the page is a sitemap or feed served behind an XSL stylesheet (which browsers render into HTML), this is the underlying XML instead — see the `type` field."},"url":{"type":"string","description":"The URL that was scraped"},"type":{"type":"string","enum":["html","xml","json","text","csv","markdown","svg","pdf","docx","doc","xlsx","xls","pptx","ppt"],"description":"Detected content type of the returned `html` field. Sitemaps and feeds are surfaced as `xml`; ordinary pages are `html`. Excel workbooks are surfaced as `xlsx`/`xls` with the extracted sheets as HTML tables; PowerPoint presentations are surfaced as `pptx`/`ppt` with the extracted slides as HTML."},"metadata":{"$ref":"#/components/schemas/PageMetadata"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"},"actionsApplied":{"type":"array","description":"One verified outcome per requested browser action, in request order.","items":{"type":"object","properties":{"instruction":{"type":"string"},"status":{"type":"string","enum":["applied","failed","skipped"],"description":"Applied means the requested page state was visibly verified. Failed means it was not verified. Skipped means it was not attempted."},"method":{"type":"string"},"targetDescription":{"type":"string"},"completionEvidence":{"type":"string","description":"Visible page evidence used to verify an applied action."},"error":{"type":"string"},"durationMs":{"type":"number"}},"required":["instruction","status"]}},"actionsHtmlStale":{"type":"boolean","description":"True when an action was applied but the returned content could not be refreshed afterward."}},"required":["success","html","url","type","metadata"]}}}},"400":{"description":"Bad request - Invalid URL or failed to scrape","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 issue"},"error_code":{"type":"string","enum":["INPUT_VALIDATION_ERROR","WEBSITE_ACCESS_ERROR","WEBSITE_BLOCKED"],"description":"Error code indicating the type of error. WEBSITE_BLOCKED means the site answered with an anti-bot challenge, CAPTCHA wall, or login shell instead of the page (often as an HTTP 200) — the request is not billed, and retrying later or from another country sometimes succeeds."},"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"}}}}}},"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"}}}}}},"404":{"description":"Target page returned a 404","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 issue"},"error_code":{"type":"string","enum":["NOT_FOUND"],"description":"Error code indicating the target page was not found"},"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"}}}}}},"413":{"description":"Content too large - the target content exceeds the maximum supported download size, so it cannot be scraped","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 naming the URL and the maximum supported size"},"error_code":{"type":"string","enum":["CONTENT_TOO_LARGE"],"description":"Error code indicating the target content exceeds the maximum supported size"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["message","error_code"]}}}},"415":{"description":"Unsupported content type - the URL resolved to a content type that is not supported (e.g. an image, presentation, media, or archive). Supported types are HTML, XML, PDF, DOCX, DOC, XLSX, XLS, PPTX, PPT, and CSV.","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 unsupported content type"},"error_code":{"type":"string","enum":["UNSUPPORTED_CONTENT"],"description":"Error code indicating an unsupported content type"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["message","error_code"]}}}},"429":{"$ref":"#/components/responses/RateLimited","description":"Response for status 429."},"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.webScrapeHTML({ url: 'https://example.com' });\n\nconsole.log(response.html);"},{"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.web_scrape_html(\n    url=\"https://example.com\",\n)\nprint(response.html)"},{"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.WebScrapeHTML(context.TODO(), contextdev.WebWebScrapeHTMLParams{\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.HTML)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.web.web_scrape_html(url: \"https://example.com\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->web->webScrapeHTML(\n    url: 'https://example.com',\n    actions: [['do' => 'wait', 'timeMs' => 0]],\n    country: 'de',\n    excludeSelectors: ['x'],\n    headers: ['foo' => 'J!'],\n    includeFrames: true,\n    includeSelectors: ['x'],\n    maxAgeMs: 0,\n    pdf: ['end' => 1, 'ocr' => true, 'shouldParse' => true, 'start' => 1],\n    settleAnimations: true,\n    tags: ['production', 'team-alpha'],\n    timeoutMs: 1,\n    useMainContentOnly: true,\n    waitForMs: 0,\n    zdr: 'enabled',\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev web web-scrape-html \\\n  --api-key 'My API Key' \\\n  --url https://example.com"}],"operationId":"get_web_scrape_html"}},"/web/scrape/markdown":{"get":{"summary":"Scrape Markdown","description":"Scrapes the given URL into LLM usable Markdown. Inspect key_metadata on JSON responses from a recognized API key; use error_code to distinguish stable failure categories.\n\n### YouTube\n\nYouTube URLs return the video or channel itself rather than the surrounding player and navigation chrome. A URL addressing a single video (`/watch`, `youtu.be`, `/shorts`, `/embed`, `/live`) returns its title, channel, duration, view count, keywords, full description, and the transcript when the video has captions that can be retrieved; videos without captions return everything except the transcript. A channel URL (`/channel/UC…`, `/@handle`, `/c/…`, `/user/…`) returns its name, handle, subscriber count, video count, and full description. When `includeImages=true`, video responses also include the thumbnail and channel responses include the avatar. Costs the same as any other scrape.\n\n### Billing & errors\n\n| HTTP status | Billed? | Meaning |\n| --- | --- | --- |\n| 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing |\n| 400 | No | Invalid input, skipped PDF, or the page could not be scraped. error_code WEBSITE_BLOCKED specifically means the site answered with an anti-bot challenge, CAPTCHA wall, or login shell instead of the page (even when the site returned HTTP 200) — retrying later or from another country sometimes succeeds |\n| 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code |\n| 404 | No | Target page returned or fingerprinted as not found |\n| 408 | No | Request timed out |\n| 413 | No | Target content exceeds the maximum supported size (20 MB) |\n| 415 | No | Unsupported content type |\n| 429 | No | Per-minute rate limit exceeded; honor Retry-After |\n| 500 | No | Internal error |","security":[{"bearerAuth":[]}],"tags":["Web Scraping"],"x-mint":{"content":"<Badge color=\"blue\">1 Credit</Badge><Badge color=\"orange\">With actions: 2 Credits</Badge>","title":"Scrape Markdown","sidebarTitle":"Scrape markdown","description":"Scrape the given URL into LLM usable Markdown"},"parameters":[{"schema":{"type":"string","minLength":1,"format":"uri","description":"Full URL to scrape into LLM usable Markdown (must include http:// or https:// protocol)"},"required":true,"description":"Full URL to scrape into LLM usable Markdown (must include http:// or https:// protocol)","name":"url","in":"query"},{"schema":{"type":"boolean","default":true,"description":"Preserve hyperlinks in Markdown output"},"required":false,"description":"Preserve hyperlinks in Markdown output","name":"includeLinks","in":"query"},{"schema":{"type":"boolean","default":false,"description":"Include image references in Markdown output"},"required":false,"description":"Include image references in Markdown output","name":"includeImages","in":"query"},{"schema":{"type":"boolean","default":true,"description":"Shorten base64-encoded image data in the Markdown output"},"required":false,"description":"Shorten base64-encoded image data in the Markdown output","name":"shortenBase64Images","in":"query"},{"schema":{"type":"boolean","default":false,"description":"Extract only the main content of the page, excluding headers, footers, sidebars, and navigation"},"required":false,"description":"Extract only the main content of the page, excluding headers, footers, sidebars, and navigation","name":"useMainContentOnly","in":"query"},{"schema":{"type":"boolean","default":false,"description":"When true, the response also includes an `html` field with the page HTML the Markdown was converted from — the same body the Scrape HTML endpoint returns for the equivalent request."},"required":false,"description":"When true, the response also includes an `html` field with the page HTML the Markdown was converted from — the same body the Scrape HTML endpoint returns for the equivalent request.","name":"includeHTML","in":"query"},{"schema":{"type":"object","properties":{"shouldParse":{"type":"boolean","default":true,"description":"When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and a 400 PDF_SKIPPED is returned."},"start":{"type":"integer","minimum":1,"description":"First 1-based PDF page to parse. When omitted, parsing starts at the first page."},"end":{"type":"integer","minimum":1,"description":"Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided."},"ocr":{"type":"boolean","default":false,"description":"When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs."}},"default":{"shouldParse":true,"ocr":false},"description":"PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range."},"required":false,"description":"PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.","name":"pdf","in":"query"},{"schema":{"type":"boolean","default":false,"description":"When true, the contents of iframes are rendered to Markdown."},"required":false,"description":"When true, the contents of iframes are rendered to Markdown.","name":"includeFrames","in":"query"},{"schema":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":2048},"maxItems":50,"description":"CSS selectors. When provided, only matching HTML subtrees (and their descendants) are kept before conversion to Markdown. When omitted, the entire document is kept. Examples: \"article.main\", \"#content\", \"[role=main]\"."},"required":false,"description":"CSS selectors. When provided, only matching HTML subtrees (and their descendants) are kept before conversion to Markdown. When omitted, the entire document is kept. Examples: \"article.main\", \"#content\", \"[role=main]\".","name":"includeSelectors","in":"query"},{"schema":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":2048},"maxItems":50,"description":"CSS selectors to remove before conversion to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: \"nav\", \"footer\", \".ad-banner\", \"[aria-hidden=true]\"."},"required":false,"description":"CSS selectors to remove before conversion to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: \"nav\", \"footer\", \".ad-banner\", \"[aria-hidden=true]\".","name":"excludeSelectors","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":2592000000,"default":86400000,"description":"Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh."},"required":false,"description":"Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.","name":"maxAgeMs","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":30000,"description":"Optional browser wait time in milliseconds after initial page load before converting the page to Markdown. Min: 0. Max: 30000 (30 seconds)."},"required":false,"description":"Optional browser wait time in milliseconds after initial page load before converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).","name":"waitForMs","in":"query"},{"schema":{"type":"boolean","default":false,"description":"When true, waits briefly for CSS and transition animations to settle before converting to Markdown. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages."},"required":false,"description":"When true, waits briefly for CSS and transition animations to settle before converting to Markdown. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.","name":"settleAnimations","in":"query"},{"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/WebScrapeAction"},"maxItems":5,"description":"Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions."},"required":false,"description":"Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions.","name":"actions","in":"query"},{"schema":{"type":"object","additionalProperties":{"type":"string","maxLength":8192,"pattern":"^[^\\r\\n]*$"},"description":"Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache."},"required":false,"description":"Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.","name":"headers","in":"query"},{"schema":{"$ref":"#/components/schemas/BrowserCountryCode"},"required":false,"description":"Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).","name":"country","in":"query"},{"schema":{"$ref":"#/components/schemas/LenientTimeoutMS"},"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":["enabled","disabled"],"default":"disabled","description":"Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true."},"required":false,"description":"Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.","name":"zdr","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"},"X-Context-ZDR":{"description":"Present with the value true when zero data retention was requested and honored.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates success"},"markdown":{"type":"string","description":"Page content converted to GitHub Flavored Markdown"},"html":{"type":"string","description":"Only present when includeHTML=true: the page HTML the Markdown was converted from — the same body the Scrape HTML endpoint returns for the equivalent request."},"contentLength":{"type":"integer","minimum":0,"description":"UTF-8 byte length of the returned Markdown. Use 0 to identify an empty result and compare small values against your workload's minimum useful-content threshold."},"url":{"type":"string","description":"The URL that was scraped"},"metadata":{"$ref":"#/components/schemas/PageMetadata"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"},"actionsApplied":{"type":"array","description":"One verified outcome per requested browser action, in request order.","items":{"type":"object","properties":{"instruction":{"type":"string"},"status":{"type":"string","enum":["applied","failed","skipped"],"description":"Applied means the requested page state was visibly verified. Failed means it was not verified. Skipped means it was not attempted."},"method":{"type":"string"},"targetDescription":{"type":"string"},"completionEvidence":{"type":"string","description":"Visible page evidence used to verify an applied action."},"error":{"type":"string"},"durationMs":{"type":"number"}},"required":["instruction","status"]}},"actionsHtmlStale":{"type":"boolean","description":"True when an action was applied but the returned content could not be refreshed afterward."}},"required":["success","markdown","contentLength","url","metadata"]}}}},"400":{"description":"Bad request - Invalid URL or failed to scrape","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 issue"},"error_code":{"type":"string","enum":["INPUT_VALIDATION_ERROR","WEBSITE_ACCESS_ERROR","WEBSITE_BLOCKED"],"description":"Error code indicating the type of error. WEBSITE_BLOCKED means the site answered with an anti-bot challenge, CAPTCHA wall, or login shell instead of the page (often as an HTTP 200) — the request is not billed, and retrying later or from another country sometimes succeeds."},"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"}}}}}},"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"}}}}}},"404":{"description":"Target page returned a 404","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 issue"},"error_code":{"type":"string","enum":["NOT_FOUND"],"description":"Error code indicating the target page was not found"},"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"}}}}}},"413":{"description":"Content too large - the target content exceeds the maximum supported download size, so it cannot be scraped","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 naming the URL and the maximum supported size"},"error_code":{"type":"string","enum":["CONTENT_TOO_LARGE"],"description":"Error code indicating the target content exceeds the maximum supported size"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["message","error_code"]}}}},"415":{"description":"Unsupported content type - the URL resolved to a content type that is not supported (e.g. an image, presentation, media, or archive). Supported types are HTML, XML, PDF, DOCX, DOC, XLSX, XLS, PPTX, PPT, and CSV.","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 unsupported content type"},"error_code":{"type":"string","enum":["UNSUPPORTED_CONTENT"],"description":"Error code indicating an unsupported content type"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["message","error_code"]}}}},"429":{"$ref":"#/components/responses/RateLimited","description":"Response for status 429."},"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.webScrapeMd({ url: 'https://example.com' });\n\nconsole.log(response.contentLength);"},{"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.web_scrape_md(\n    url=\"https://example.com\",\n)\nprint(response.content_length)"},{"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.WebScrapeMd(context.TODO(), contextdev.WebWebScrapeMdParams{\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.ContentLength)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.web.web_scrape_md(url: \"https://example.com\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->web->webScrapeMd(\n    url: 'https://example.com',\n    actions: [['do' => 'wait', 'timeMs' => 0]],\n    country: 'de',\n    excludeSelectors: ['x'],\n    headers: ['foo' => 'J!'],\n    includeFrames: true,\n    includeHTML: true,\n    includeImages: true,\n    includeLinks: true,\n    includeSelectors: ['x'],\n    maxAgeMs: 0,\n    pdf: ['end' => 1, 'ocr' => true, 'shouldParse' => true, 'start' => 1],\n    settleAnimations: true,\n    shortenBase64Images: true,\n    tags: ['production', 'team-alpha'],\n    timeoutMs: 1,\n    useMainContentOnly: true,\n    waitForMs: 0,\n    zdr: 'enabled',\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev web web-scrape-md \\\n  --api-key 'My API Key' \\\n  --url https://example.com"}],"operationId":"get_web_scrape_markdown"}},"/web/scrape/images":{"get":{"summary":"Scrape Images","description":"Extract image assets from a web page, including standard URLs, inline SVGs, data URIs, responsive image sources, metadata, CSS backgrounds, video posters, and embeds. The base request costs 1 credit, or 2 credits with browser actions. When enrichment is enabled, the entire call costs 5 credits, including requests that also use actions.","security":[{"bearerAuth":[]}],"tags":["Web Scraping"],"x-mint":{"content":"<Badge color=\"blue\">1 Credit</Badge><Badge color=\"orange\">With actions: 2 Credits</Badge><Badge color=\"orange\">Enriched: 5 Credits</Badge>","title":"Scrape Images","sidebarTitle":"Scrape images","description":"Extract image assets from a page."},"parameters":[{"schema":{"type":"string","minLength":1,"format":"uri","description":"Page URL to inspect. Must include http:// or https://."},"required":true,"description":"Page URL to inspect. Must include http:// or https://.","name":"url","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":2592000000,"default":86400000,"description":"Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days)."},"required":false,"description":"Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).","name":"maxAgeMs","in":"query"},{"schema":{"type":["object","null"],"properties":{"resolution":{"type":"boolean","default":false,"description":"Measure image width and height when possible."},"hostedUrl":{"type":"boolean","default":false,"description":"Host materializable images on the Brand.dev CDN and return their URL and MIME type."},"classification":{"type":"boolean","default":false,"description":"Classify each image by visual asset type."},"maxTimePerMs":{"type":"integer","minimum":1,"maximum":60000,"default":30000,"description":"Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000."}},"additionalProperties":false,"description":"Optional per-image processing, sent as deep-object query params such as enrichment[resolution]=true."},"required":false,"description":"Optional per-image processing, sent as deep-object query params such as enrichment[resolution]=true.","name":"enrichment","in":"query"},{"schema":{"type":"boolean","default":false,"description":"When true, visually duplicate images are removed: every image is loaded and perceptually hashed, and only the highest-resolution copy of each duplicate group is kept. Images that cannot be downloaded or hashed are kept. Default: false."},"required":false,"description":"When true, visually duplicate images are removed: every image is loaded and perceptually hashed, and only the highest-resolution copy of each duplicate group is kept. Images that cannot be downloaded or hashed are kept. Default: false.","name":"dedupe","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":30000,"description":"Optional browser wait time in milliseconds after initial page load before collecting images. Min: 0. Max: 30000 (30 seconds)."},"required":false,"description":"Optional browser wait time in milliseconds after initial page load before collecting images. Min: 0. Max: 30000 (30 seconds).","name":"waitForMs","in":"query"},{"schema":{"type":["array","null"],"items":{"$ref":"#/components/schemas/WebScrapeAction"},"maxItems":5,"description":"Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions."},"required":false,"description":"Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions.","name":"actions","in":"query"},{"schema":{"type":"object","additionalProperties":{"type":"string","maxLength":8192,"pattern":"^[^\\r\\n]*$"},"description":"Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache."},"required":false,"description":"Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.","name":"headers","in":"query"},{"schema":{"$ref":"#/components/schemas/LenientTimeoutMS"},"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":{"success":{"type":"boolean","enum":[true],"description":"Always true on success."},"images":{"type":"array","description":"Images found on the page.","items":{"type":"object","properties":{"src":{"type":"string","description":"Original image value: URL, inline SVG or HTML, or base64 data URI."},"element":{"type":"string","enum":["img","svg","link","source","video","css","object","meta","background"],"description":"Where the image was found."},"type":{"type":"string","enum":["url","html","base64"],"description":"Format of src."},"alt":{"type":["string","null"],"description":"Image alt text, or null when unavailable."},"enrichment":{"type":"object","description":"Requested metadata for images that could be processed.","properties":{"width":{"type":"integer","description":"Image width in pixels, when measured."},"height":{"type":"integer","description":"Image height in pixels, when measured."},"mimetype":{"type":"string","description":"Detected MIME type, when hosted."},"url":{"type":"string","format":"uri","description":"Brand.dev CDN URL, when hosted."},"type":{"type":"string","enum":["photography","illustration","logo","wordmark","icon","pattern","graphic","other"],"description":"Visual asset category, when classified."}}}},"required":["src","element","type","alt"]}},"url":{"type":"string","description":"Page URL that was scraped."},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"},"actionsApplied":{"type":"array","description":"One verified outcome per requested browser action, in request order.","items":{"type":"object","properties":{"instruction":{"type":"string"},"status":{"type":"string","enum":["applied","failed","skipped"],"description":"Applied means the requested page state was visibly verified. Failed means it was not verified. Skipped means it was not attempted."},"method":{"type":"string"},"targetDescription":{"type":"string"},"completionEvidence":{"type":"string","description":"Visible page evidence used to verify an applied action."},"error":{"type":"string"},"durationMs":{"type":"number"}},"required":["instruction","status"]}}},"required":["success","images","url"]}}}},"400":{"description":"Invalid URL or scrape failed.","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 issue"},"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"}}}}}},"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","description":"Response for status 429."},"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.webScrapeImages({ url: 'https://example.com' });\n\nconsole.log(response.images);"},{"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.web_scrape_images(\n    url=\"https://example.com\",\n)\nprint(response.images)"},{"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.WebScrapeImages(context.TODO(), contextdev.WebWebScrapeImagesParams{\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.Images)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.web.web_scrape_images(url: \"https://example.com\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->web->webScrapeImages(\n    url: 'https://example.com',\n    actions: [['do' => 'wait', 'timeMs' => 0]],\n    dedupe: true,\n    enrichment: [\n      'classification' => true,\n      'hostedURL' => true,\n      'maxTimePerMs' => 1,\n      'resolution' => true,\n    ],\n    headers: ['foo' => 'J!'],\n    maxAgeMs: 0,\n    tags: ['production', 'team-alpha'],\n    timeoutMs: 1,\n    waitForMs: 0,\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev web web-scrape-images \\\n  --api-key 'My API Key' \\\n  --url https://example.com"}],"operationId":"get_web_scrape_images"}},"/web/scrape/sitemap":{"get":{"summary":"Crawl Sitemap","description":"Crawl an entire website's sitemap and return all discovered page URLs. Pass `search` to have the crawled sitemap filtered down to the pages about a phrase (for example `pricing and plans` or `api authentication docs`), most relevant first — a searched crawl scans the whole sitemap and costs 2 credits instead of 1.","security":[{"bearerAuth":[]}],"tags":["Web Scraping"],"x-mint":{"content":"<Badge color=\"blue\">1 Credit</Badge>","title":"Crawl Sitemap","sidebarTitle":"Crawl sitemap","description":"Crawl a domain's sitemap and return all discovered page URLs"},"parameters":[{"schema":{"type":"string","minLength":3,"description":"Domain to build a sitemap for"},"required":true,"description":"Domain to build a sitemap for","name":"domain","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100000,"default":10000,"description":"Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Minimum is 1, maximum is 100,000."},"required":false,"description":"Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Minimum is 1, maximum is 100,000.","name":"maxLinks","in":"query"},{"schema":{"type":"string","format":"uri","description":"Optional explicit sitemap URL. When provided, exactly this sitemap is crawled instead of discovering the domain's sitemaps."},"required":false,"description":"Optional explicit sitemap URL. When provided, exactly this sitemap is crawled instead of discovering the domain's sitemaps.","name":"sitemapUrl","in":"query"},{"schema":{"type":"string","maxLength":256,"description":"Optional RE2-compatible regex pattern. Only URLs matching this pattern are returned and counted against maxLinks.","example":"^https?://[^/]+/blog/"},"required":false,"description":"Optional RE2-compatible regex pattern. Only URLs matching this pattern are returned and counted against maxLinks.","name":"urlRegex","in":"query"},{"schema":{"type":"string","minLength":2,"maxLength":200,"description":"Optional search phrase. When provided, the crawled sitemap is filtered to the pages whose URLs are about that phrase, most relevant first, and the request costs 2 credits instead of 1.","example":"help center and troubleshooting articles"},"required":false,"description":"Optional search phrase. When provided, the crawled sitemap is filtered to the pages whose URLs are about that phrase, most relevant first, and the request costs 2 credits instead of 1.","name":"search","in":"query"},{"schema":{"type":"object","additionalProperties":{"type":"string","maxLength":8192,"pattern":"^[^\\r\\n]*$"},"description":"Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache."},"required":false,"description":"Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.","name":"headers","in":"query"},{"schema":{"$ref":"#/components/schemas/LenientTimeoutMS"},"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":["enabled","disabled"],"default":"disabled","description":"Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true."},"required":false,"description":"Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.","name":"zdr","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"},"X-Context-ZDR":{"description":"Present with the value true when zero data retention was requested and honored.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Indicates success"},"domain":{"type":"string","description":"The normalized domain that was crawled"},"urls":{"type":"array","items":{"type":"string"},"description":"Discovered page URLs from the sitemap, up to `maxLinks`. When `search` is set these are only the matching pages, most relevant first."},"meta":{"type":"object","description":"Metadata about the sitemap crawl operation","properties":{"sitemapsDiscovered":{"type":"integer","description":"Total number of sitemap files discovered"},"sitemapsFetched":{"type":"integer","description":"Number of sitemap files successfully fetched and parsed"},"sitemapsSkipped":{"type":"integer","description":"Number of sitemap files skipped (due to errors, timeouts, or limits)"},"errors":{"type":"integer","description":"Number of errors encountered during crawling"}},"required":["sitemapsDiscovered","sitemapsFetched","sitemapsSkipped","errors"]},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["success","domain","urls","meta"]}}}},"400":{"description":"Bad request - Invalid domain","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 issue"},"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"}}}}}},"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","description":"Response for status 429."},"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.webScrapeSitemap({ domain: 'xxx' });\n\nconsole.log(response.domain);"},{"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.web_scrape_sitemap(\n    domain=\"xxx\",\n)\nprint(response.domain)"},{"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.WebScrapeSitemap(context.TODO(), contextdev.WebWebScrapeSitemapParams{\n\t\tDomain: \"xxx\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Domain)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.web.web_scrape_sitemap(domain: \"xxx\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->web->webScrapeSitemap(\n    domain: 'xxx',\n    headers: ['foo' => 'J!'],\n    maxLinks: 1,\n    search: 'help center and troubleshooting articles',\n    sitemapURL: 'https://example.com',\n    tags: ['production', 'team-alpha'],\n    timeoutMs: 1,\n    urlRegex: '^https?://[^/]+/blog/',\n    zdr: 'enabled',\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev web web-scrape-sitemap \\\n  --api-key 'My API Key' \\\n  --domain xxx"}],"operationId":"get_web_scrape_sitemap"}},"/web/crawl":{"post":{"summary":"Crawl Website & Scrape Markdown","description":"Performs a crawl starting from a given URL, extracts page content as Markdown, and returns results for all crawled pages.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The starting URL for the crawl (must include http:// or https:// protocol)"},"maxPages":{"type":"integer","minimum":1,"maximum":500,"default":100,"description":"Maximum number of pages to crawl. Hard cap: 500."},"maxDepth":{"type":"integer","minimum":0,"description":"Maximum link depth from the starting URL (0 = only the starting page)"},"urlRegex":{"type":"string","description":"Regex pattern. Only URLs matching this pattern will be followed and scraped. An automatic prefix scope in the form ^<starting URL> follows a redirect of the starting page.","example":"^https?://[^/]+/blog/"},"includeLinks":{"type":"boolean","default":true,"description":"Preserve hyperlinks in the Markdown output"},"includeImages":{"type":"boolean","default":false,"description":"Include image references in the Markdown output"},"shortenBase64Images":{"type":"boolean","default":true,"description":"Truncate base64-encoded image data in the Markdown output"},"useMainContentOnly":{"type":"boolean","default":false,"description":"Extract only the main content, stripping headers, footers, sidebars, and navigation"},"followSubdomains":{"type":"boolean","default":false,"description":"When true, follow links on subdomains of the starting URL's domain (e.g. docs.example.com when starting from example.com). www and apex are always treated as equivalent."},"pdf":{"type":"object","properties":{"shouldParse":{"type":"boolean","default":true,"description":"When true, PDF pages are fetched and parsed. When false, PDF pages are skipped entirely (not included in results and not counted as failures)."},"ocr":{"type":"boolean","default":false,"description":"When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost."},"start":{"type":"integer","minimum":1,"description":"First 1-based PDF page to parse. When omitted, parsing starts at the first page."},"end":{"type":"integer","minimum":1,"description":"Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided."}},"additionalProperties":false,"default":{"shouldParse":true,"ocr":false},"description":"PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range."},"includeFrames":{"type":"boolean","default":false,"description":"When true, the contents of iframes are rendered to Markdown for each crawled page."},"includeSelectors":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":2048},"description":"CSS selectors. When provided, only matching HTML subtrees (and their descendants) are kept before each crawled page is converted to Markdown. When omitted, the entire document is kept. Examples: \"article.main\", \"#content\", \"[role=main]\"."},"excludeSelectors":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":2048},"description":"CSS selectors to remove before each crawled page is converted to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: \"nav\", \"footer\", \".ad-banner\", \"[aria-hidden=true]\"."},"maxAgeMs":{"type":"integer","minimum":0,"maximum":2592000000,"default":86400000,"description":"Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh."},"waitForMs":{"type":"integer","minimum":0,"maximum":30000,"default":3500,"description":"Browser wait time in milliseconds after initial page load for each crawled page. Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds)."},"settleAnimations":{"type":"boolean","default":false,"description":"When true, waits briefly for CSS and transition animations to settle before extracting each crawled page. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages."},"stopAfterMs":{"type":"integer","minimum":10000,"maximum":110000,"default":80000,"description":"Soft time budget for the crawl in milliseconds. After each scrape, the crawler checks the elapsed time and, if exceeded, returns the pages collected so far instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s)."},"country":{"$ref":"#/components/schemas/BrowserCountryCode"},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"zdr":{"type":"string","enum":["enabled","disabled"],"default":"disabled","description":"Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true."},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["url"]}}}},"security":[{"bearerAuth":[]}],"tags":["Web Scraping"],"x-mint":{"content":"<Badge color=\"blue\">1 Credit Per Page</Badge>","title":"Crawl Website & Scrape Markdown","sidebarTitle":"Crawl website & scrape markdown","description":"Crawl an entire website and extract pages' content as LLM usable Markdown"},"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"},"X-Context-ZDR":{"description":"Present with the value true when zero data retention was requested and honored.","schema":{"type":"string","enum":["true"]}}},"content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"markdown":{"type":"string","description":"Extracted page content as Markdown (empty string on failure)"},"metadata":{"allOf":[{"$ref":"#/components/schemas/PageMetadata"},{"type":"object","properties":{"url":{"type":"string","description":"The crawl URL fetched for this page."},"title":{"type":"string","description":"Best page title extracted from the page (empty string if unavailable)."},"crawlDepth":{"type":"integer","description":"Depth relative to the start URL. 0 = start URL, 1 = one link away."},"statusCode":{"type":"integer","description":"HTTP status code of the response"},"success":{"type":"boolean","description":"true if the page was fetched and parsed successfully"}},"required":["url","title","crawlDepth","statusCode","success"]}]}},"required":["markdown","metadata"]}},"metadata":{"type":"object","properties":{"numUrls":{"type":"integer","description":"Total number of URLs crawled"},"maxCrawlDepth":{"type":"integer","description":"Maximum crawl depth reached during the crawl"},"numSucceeded":{"type":"integer","description":"Number of pages successfully crawled"},"numFailed":{"type":"integer","description":"Number of pages that failed to crawl"},"numSkipped":{"type":"integer","description":"Number of URLs skipped (PDFs when pdf.shouldParse=false, or URLs not matching urlRegex)"}},"required":["numUrls","maxCrawlDepth","numSucceeded","numFailed","numSkipped"]},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["results","metadata"]}}}},"400":{"description":"Bad request - Invalid URL or 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 issue"},"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"}}}}}},"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"}}}}}},"404":{"description":"Start URL returned a 404","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 issue"},"error_code":{"type":"string","enum":["NOT_FOUND"],"description":"Error code indicating the start URL was not found"},"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"}}}}}},"415":{"description":"Unsupported content type - the start URL resolved to a content type that is not supported (e.g. an image, presentation, media, or archive). Supported types are HTML, XML, PDF, DOCX, DOC, XLSX, XLS, PPTX, PPT, and CSV.","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 unsupported content type"},"error_code":{"type":"string","enum":["UNSUPPORTED_CONTENT"],"description":"Error code indicating an unsupported content type"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["message","error_code"]}}}},"429":{"$ref":"#/components/responses/RateLimited","description":"Response for status 429."},"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.webCrawlMd({ url: 'https://example.com' });\n\nconsole.log(response.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.web.web_crawl_md(\n    url=\"https://example.com\",\n)\nprint(response.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.Web.WebCrawlMd(context.TODO(), contextdev.WebWebCrawlMdParams{\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.Metadata)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.web.web_crawl_md(url: \"https://example.com\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->web->webCrawlMd(\n    url: 'https://example.com',\n    country: 'de',\n    excludeSelectors: ['string'],\n    followSubdomains: true,\n    includeFrames: true,\n    includeImages: true,\n    includeLinks: true,\n    includeSelectors: ['string'],\n    maxAgeMs: 0,\n    maxDepth: 0,\n    maxPages: 1,\n    pdf: ['end' => 1, 'ocr' => true, 'shouldParse' => true, 'start' => 1],\n    settleAnimations: true,\n    shortenBase64Images: true,\n    stopAfterMs: 10000,\n    tags: ['production', 'team-alpha'],\n    timeoutMs: 1000,\n    urlRegex: '^https?://[^/]+/blog/',\n    useMainContentOnly: true,\n    waitForMs: 0,\n    zdr: 'enabled',\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev web web-crawl-md \\\n  --api-key 'My API Key' \\\n  --url https://example.com"}],"operationId":"post_web_crawl"}},"/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. Image fields such as `image_urls` or `product_photos` automatically make page image references available to extraction, so product data and photos can be returned in one call. 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."},"settleAnimations":{"type":"boolean","default":false,"description":"When true, waits briefly for CSS and transition animations to settle before extracting each crawled page. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages."},"actions":{"type":"array","maxItems":5,"description":"Optional browser actions executed in order on the requested page after it loads, before links are discovered or additional pages are crawled. Requires a paid plan. When actions are provided and stopAfterMs is omitted, the crawl budget defaults to 110000 ms.","items":{"$ref":"#/components/schemas/WebScrapeAction"}},"stopAfterMs":{"type":"integer","minimum":10000,"maximum":110000,"default":80000,"description":"Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are provided."},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["url","schema"],"additionalProperties":false}}}},"security":[{"bearerAuth":[]}],"tags":["Web Extraction"],"x-mint":{"content":"<Badge color=\"blue\">10 Credits</Badge>","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."},"actionsApplied":{"type":"array","description":"One verified outcome per requested browser action, in request order.","items":{"type":"object","properties":{"instruction":{"type":"string"},"status":{"type":"string","enum":["applied","failed","skipped"],"description":"Applied means the requested page state was visibly verified. Failed means it was not verified. Skipped means it was not attempted."},"method":{"type":"string"},"targetDescription":{"type":"string"},"completionEvidence":{"type":"string","description":"Visible page evidence used to verify an applied action."},"error":{"type":"string"},"durationMs":{"type":"number"}},"required":["instruction","status"]}}},"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","description":"Response for status 429."},"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":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->web->extract(\n    schema: [\n      'type' => 'bar',\n      'properties' => 'bar',\n      'required' => 'bar',\n      'additionalProperties' => 'bar',\n    ],\n    url: 'https://example.com',\n    actions: [['do' => 'wait', 'timeMs' => 0]],\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    settleAnimations: true,\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"}],"operationId":"post_web_extract"}},"/web/search":{"post":{"summary":"Web Search","description":"Search the web and optionally scrape each result to Markdown in one round-trip.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":500,"description":"Search query. Accepts natural language as well as Google-style search operators such as `site:`, `-site:`, `inurl:`, `intitle:`, quoted phrases, and `OR`."},"numResults":{"type":"integer","minimum":10,"maximum":100,"default":10,"description":"Number of results to request and return (10–100). Defaults to 10."},"includeDomains":{"type":"array","items":{"type":"string"},"description":"Allowlist — only return results from these domains. Example: [\"arxiv.org\", \"github.com\"]."},"excludeDomains":{"type":"array","items":{"type":"string"},"description":"Blocklist — drop results from these domains. Example: [\"pinterest.com\", \"reddit.com\"]."},"freshness":{"type":"string","enum":["last_24_hours","last_week","last_month","last_year"],"description":"Restrict results to content published within this window."},"country":{"type":"string","enum":["af","al","dz","as","ad","ao","ai","aq","ag","ar","am","aw","au","at","az","bs","bh","bd","bb","by","be","bz","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","ky","cf","td","cl","cn","cx","cc","co","km","cg","cd","ck","cr","ci","hr","cu","cy","cz","dk","dj","dm","do","ec","eg","sv","gq","er","ee","et","fk","fo","fj","fi","fr","gf","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gd","gp","gu","gt","gn","gw","gy","ht","hm","va","hn","hk","hu","is","in","id","ir","iq","ie","il","it","jm","jp","jo","kz","ke","ki","kp","kr","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mq","mr","mu","yt","mx","fm","md","mc","mn","ms","ma","mz","mm","na","nr","np","nl","an","nc","nz","ni","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pa","pg","py","pe","ph","pn","pl","pt","pr","qa","re","ro","ru","rw","sh","kn","lc","pm","vc","ws","sm","st","sa","sn","rs","sc","sl","sg","sk","si","sb","so","za","gs","es","lk","sd","sr","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tt","tn","tr","tm","tc","tv","ug","ua","ae","gb","us","um","uy","uz","vu","ve","vn","vg","vi","wf","eh","ye","zm","zw"],"description":"Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific country (maps to Google's `gl` parameter). Example: \"us\", \"gb\", \"de\"."},"queryFanout":{"type":"boolean","description":"Expand the query into multiple parallel variants for broader recall."},"markdownOptions":{"type":"object","additionalProperties":false,"description":"Inline Markdown scraping for each result. Set `enabled: true` to activate.","properties":{"enabled":{"type":"boolean","default":false,"description":"Scrape each result to Markdown. Off by default to keep search cheap and fast."},"includeLinks":{"type":"boolean","default":true,"description":"Keep hyperlinks in the Markdown."},"includeImages":{"type":"boolean","default":false,"description":"Emit image references in the Markdown."},"shortenBase64Images":{"type":"boolean","default":true,"description":"Truncate inline base64 image payloads to keep responses small."},"useMainContentOnly":{"type":"boolean","default":false,"description":"Strip nav, header, footer, and sidebar — keep only the primary article content."},"pdf":{"type":"object","properties":{"shouldParse":{"type":"boolean","default":true,"description":"Parse PDF URLs. When false, PDF results are skipped with WEBSITE_ACCESS_ERROR."},"start":{"type":"integer","minimum":1,"description":"First PDF page to parse (1-based, inclusive). Defaults to page 1."},"end":{"type":"integer","minimum":1,"description":"Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must be >= start."}},"additionalProperties":false,"default":{"shouldParse":true},"description":"PDF handling. Use start/end to bound text extraction and OCR to a page range."},"includeFrames":{"type":"boolean","default":false,"description":"Render iframe contents into the Markdown."},"maxAgeMs":{"type":"integer","minimum":0,"maximum":2592000000,"default":86400000,"description":"Cache TTL in ms for scraped Markdown keyed by URL + options. Default 1 day, max 30 days. Set to 0 to force a fresh scrape."},"waitForMs":{"type":"integer","minimum":0,"maximum":30000,"description":"Extra wait after page load before rendering, in ms (0–30000). Useful for JS-heavy pages."},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"}}},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"tags":{"$ref":"#/components/schemas/RequestTags"}},"required":["query"],"additionalProperties":false}}}},"security":[{"bearerAuth":[]}],"tags":["Web Scraping"],"x-mint":{"content":"<Badge color=\"blue\">1 Credit Per 10 Results</Badge>"},"responses":{"200":{"description":"Search succeeded. Results are ordered by relevance.","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":{"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Canonical result URL."},"title":{"type":"string","description":"Page title."},"description":{"type":"string","description":"Snippet excerpt from the page."},"relevance":{"type":"string","enum":["high","medium","low"],"description":"Relevance to the original query."},"markdown":{"type":"object","properties":{"markdown":{"type":["string","null"],"description":"GFM Markdown of the page. Null unless markdownOptions.enabled is true and scraping succeeded."},"code":{"type":"string","enum":["SUCCESS","NOT_REQUESTED","TIMEOUT","CONTENT_TOO_LARGE","WEBSITE_ACCESS_ERROR","ERROR"],"description":"Per-result scrape outcome. Inspect this before reading `markdown`."}},"required":["markdown","code"],"additionalProperties":false,"description":"Markdown scrape status and content for this result."}},"required":["url","title","description","relevance","markdown"]}},"query":{"type":"string","description":"Echo of the original query (useful when fanout was enabled)."},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["results","query"]}}}},"400":{"description":"Bad request - Invalid 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 issue"},"error_code":{"type":"string","enum":["INPUT_VALIDATION_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"}}}}}},"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","description":"Response for status 429."},"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.search({ query: 'x' });\n\nconsole.log(response.query);"},{"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.search(\n    query=\"x\",\n)\nprint(response.query)"},{"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.Search(context.TODO(), contextdev.WebSearchParams{\n\t\tQuery: \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Query)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.web.search(query: \"x\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->web->search(\n    query: 'x',\n    country: 'af',\n    excludeDomains: ['string'],\n    freshness: 'last_24_hours',\n    includeDomains: ['string'],\n    markdownOptions: [\n      'enabled' => true,\n      'includeFrames' => true,\n      'includeImages' => true,\n      'includeLinks' => true,\n      'maxAgeMs' => 0,\n      'pdf' => ['end' => 1, 'shouldParse' => true, 'start' => 1],\n      'shortenBase64Images' => true,\n      'timeoutMs' => 1000,\n      'useMainContentOnly' => true,\n      'waitForMs' => 0,\n    ],\n    numResults: 10,\n    queryFanout: true,\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 search \\\n  --api-key 'My API Key' \\\n  --query x"}],"operationId":"post_web_search"}},"/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":"<Badge color=\"orange\">10 Credits</Badge> <Badge color=\"purple\">Private Alpha</Badge>","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","description":"Response for status 429."},"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\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.web.extract_competitors(domain: \"xxx\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->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"}],"operationId":"get_web_competitors"}},"/people/enrich":{"post":{"summary":"Enrich Person","description":"Finds and normalizes the best available person candidate from additive identity clues, then assigns an identity match score from 0 to 100. Available on all paid plans. Successful requests cost 20 credits. Disposable and free email addresses (like gmail.com, yahoo.com) will throw a 422 error.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonEnrichmentRequest"},"example":{"social_urls":["https://www.linkedin.com/in/ada-lovelace/"],"name":{"first":"Ada","last":"Lovelace"},"company":{"name":"Analytical Engines","domain":"analyticalengines.example"}}}}},"security":[{"bearerAuth":[]}],"tags":["People"],"x-mint":{"content":"<Badge color=\"blue\">20 Credits</Badge> <Badge color=\"green\">All Paid Plans</Badge> <Badge color=\"purple\">Beta Feature</Badge>","title":"Enrich Person","sidebarTitle":"Enrich person","description":"Enrich a person from combined identity clues and receive an identity match score."},"responses":{"200":{"description":"The highest-scoring candidate, including weak matches, or a not-found result when no usable candidate exists.","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/PersonEnrichmentResponse"}}}},"400":{"description":"Bad request - Insufficient or invalid identity clues","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"}}}},"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"}}}},"422":{"description":"Unprocessable Entity - Free email or disposable email detected","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"},"status":{"type":"string","description":"Status of the response, e.g., 'error'"},"error_code":{"type":"string","enum":["FREE_EMAIL_DETECTED","DISPOSABLE_EMAIL_DETECTED"],"description":"Error code indicating whether a free email provider or disposable email was detected"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}}}}}},"429":{"$ref":"#/components/responses/RateLimited","description":"Response for status 429."},"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"}}}},"502":{"description":"External provider 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.people.enrich({\n  company: { name: 'Analytical Engines', domain: 'analyticalengines.example' },\n  name: { first: 'Ada', last: 'Lovelace' },\n  social_urls: ['https://www.linkedin.com/in/ada-lovelace/'],\n});\n\nconsole.log(response.match);"},{"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.people.enrich(\n    company={\n        \"name\": \"Analytical Engines\",\n        \"domain\": \"analyticalengines.example\",\n    },\n    name={\n        \"first\": \"Ada\",\n        \"last\": \"Lovelace\",\n    },\n    social_urls=[\"https://www.linkedin.com/in/ada-lovelace/\"],\n)\nprint(response.match)"},{"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.People.Enrich(context.TODO(), contextdev.PersonEnrichParams{\n\t\tCompany: contextdev.PersonEnrichParamsCompany{\n\t\t\tName:   contextdev.String(\"Analytical Engines\"),\n\t\t\tDomain: contextdev.String(\"analyticalengines.example\"),\n\t\t},\n\t\tName: contextdev.PersonEnrichParamsName{\n\t\t\tFirst: contextdev.String(\"Ada\"),\n\t\t\tLast:  contextdev.String(\"Lovelace\"),\n\t\t},\n\t\tSocialURLs: []string{\"https://www.linkedin.com/in/ada-lovelace/\"},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Match)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.people.enrich\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->people->enrich(\n    company: [\n      'domain' => 'analyticalengines.example', 'name' => 'Analytical Engines'\n    ],\n    education: [\n      [\n        'degree' => 'x',\n        'fieldOfStudy' => 'x',\n        'graduationYear' => 1900,\n        'institution' => ['domain' => 'x', 'name' => 'x'],\n      ],\n    ],\n    email: 'dev@stainless.com',\n    location: ['city' => 'x', 'country' => 'x', 'region' => 'x'],\n    name: ['first' => 'Ada', 'last' => 'Lovelace'],\n    socialURLs: ['https://www.linkedin.com/in/ada-lovelace/'],\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 people enrich \\\n  --api-key 'My API Key'"}],"operationId":"post_people_enrich"}},"/people/retrieve":{"post":{"x-hidden":true,"summary":"Retrieve Person","description":"Retrieve and normalize a person profile from identifiers. Education and experience entries include LinkedIn-derived organization data (website, logo, employee counts, followers, headquarters, and Context.dev industry classification) when available.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonRetrieveRequest"},"example":{"identifiers":{"linkedinUrl":"https://www.linkedin.com/in/yahia-bakour/"}}}}},"security":[{"bearerAuth":[]}],"tags":["People"],"x-mint":{"content":"<Badge color=\"blue\">50 Credits</Badge> <Badge color=\"purple\">Private Alpha</Badge>","title":"Retrieve Person","sidebarTitle":"Retrieve person","description":"Normalize a person profile from LinkedIn and personal website sources."},"responses":{"200":{"description":"Person retrieval 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":{"$ref":"#/components/schemas/PersonRetrieveResponse"}}}},"400":{"description":"Bad request - Invalid identifiers","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"}}}},"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","description":"Response for status 429."},"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"}}}},"502":{"description":"External provider 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"}}}}},"operationId":"post_people_retrieve"}},"/brand/retrieve":{"get":{"x-hidden":true,"summary":"Retrieve brand data by domain","description":"Retrieve logos, backdrops, colors, industry, description, and more from any domain","security":[{"bearerAuth":[]}],"tags":["Brand Intelligence"],"x-mint":{"content":"<Badge color=\"blue\">20 Credits</Badge> <Badge color=\"green\">All Paid Plans</Badge> <Badge color=\"purple\">Beta Feature</Badge>"},"parameters":[{"schema":{"type":"string","minLength":3,"description":"Domain name to retrieve brand data for (e.g., 'example.com', 'google.com'). Cannot be used with name or ticker parameters."},"required":false,"description":"Domain name to retrieve brand data for (e.g., 'example.com', 'google.com'). Cannot be used with name or ticker parameters.","name":"domain","in":"query"},{"schema":{"type":"string","minLength":3,"maxLength":30,"description":"Company name to retrieve brand data for (e.g., 'Apple Inc'). Cannot be used with domain or ticker parameters."},"required":false,"description":"Company name to retrieve brand data for (e.g., 'Apple Inc'). Cannot be used with domain or ticker parameters.","name":"name","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":15,"pattern":"^[A-Za-z0-9.]+$","description":"Stock ticker symbol to retrieve brand data for (e.g., 'AAPL'). Cannot be used with domain or name parameters."},"required":false,"description":"Stock ticker symbol to retrieve brand data for (e.g., 'AAPL'). Cannot be used with domain or name parameters.","name":"ticker","in":"query"},{"schema":{"$ref":"#/components/schemas/StockExchange"},"required":false,"description":"Stock exchange code.","name":"ticker_exchange","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/SupportedLanguage"},{"type":["string","null"]}]},"required":false,"description":"Language to force for the retrieved brand data.","name":"force_language","in":"query"},{"schema":{"type":"boolean","default":false,"description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data. Works with all three lookup methods."},"required":false,"description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data. Works with all three lookup methods.","name":"maxSpeed","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":{"$ref":"#/components/schemas/BrandResponse"}}}},"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","description":"Response for status 429."}},"operationId":"get_brand_retrieve"},"post":{"summary":"Retrieve brand data","description":"Retrieve logos, backdrops, colors, industry, description, and more. Provide exactly one lookup identifier in the request body: a domain, company name, email address, stock ticker, transaction descriptor, or direct URL. Note: `by_direct_url` fetches brand data only from the provided URL — not from the entire internet.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandRetrieveRequest"},"examples":{"domain":{"summary":"By domain","value":{"type":"by_domain","domain":"stripe.com"}},"name":{"summary":"By name","value":{"type":"by_name","name":"Stripe"}},"email":{"summary":"By email","value":{"type":"by_email","email":"jane@stripe.com"}},"ticker":{"summary":"By stock","value":{"type":"by_ticker","ticker":"AAPL","ticker_exchange":"NASDAQ"}},"direct_url":{"summary":"By direct URL","value":{"type":"by_direct_url","direct_url":"https://stripe.com/enterprise"}},"transaction":{"summary":"By transaction","value":{"type":"by_transaction","transaction_info":"SQ *COFFEE SHOP","country_gl":"us","mcc":5814,"high_confidence_only":true}}}}}},"security":[{"bearerAuth":[]}],"tags":["Brand Intelligence"],"x-mint":{"content":"<Badge color=\"orange\">10 Credits</Badge>"},"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":{"$ref":"#/components/schemas/BrandResponse"}}}},"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":{"$ref":"#/components/schemas/ErrorResponse"}}}},"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":{"$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"}}}},"422":{"description":"Unprocessable Entity - Free email or disposable email detected","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","description":"Response for status 429."}},"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 brand = await client.brand.retrieve({ domain: 'stripe.com', type: 'by_domain' });\n\nconsole.log(brand.brand);"},{"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)\nbrand = client.brand.retrieve(\n    domain=\"stripe.com\",\n    type=\"by_domain\",\n)\nprint(brand.brand)"},{"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\tbrand, err := client.Brand.Get(context.TODO(), contextdev.BrandGetParams{\n\t\tOfByDomain: &contextdev.BrandGetParamsBodyByDomain{\n\t\t\tDomain: \"stripe.com\",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", brand.Brand)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nbrand = context_dev.brand.retrieve(body: {domain: \"stripe.com\", type: :by_domain})\n\nputs(brand)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $brand = $client->brand->retrieve(\n    domain: 'xxx',\n    type: 'by_transaction',\n    forceLanguage: 'afrikaans',\n    maxAgeMs: 0,\n    maxSpeed: true,\n    tags: ['production', 'team-alpha'],\n    timeoutMs: 1000,\n    name: 'xxx',\n    countryGl: 'country_gl',\n    email: 'dev@stainless.com',\n    ticker: 'ticker',\n    tickerExchange: 'ticker_exchange',\n    directURL: 'https://example.com',\n    transactionInfo: 'xxx',\n    city: 'city',\n    highConfidenceOnly: true,\n    mcc: 'string',\n    phone: 'string',\n  );\n\n  var_dump($brand);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev brand retrieve \\\n  --api-key 'My API Key' \\\n  --domain xxx \\\n  --type by_domain \\\n  --name xxx \\\n  --email dev@stainless.com \\\n  --ticker ticker \\\n  --direct-url https://example.com \\\n  --transaction-info xxx"}],"operationId":"post_brand_retrieve"}},"/brand/retrieve-by-name":{"get":{"x-hidden":true,"summary":"Retrieve brand data by company name","description":"Retrieve brand information using a company name.","security":[{"bearerAuth":[]}],"tags":["Brand Intelligence"],"x-mint":{"content":"<Badge color=\"orange\">10 Credits</Badge>"},"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":30,"description":"Company name to retrieve brand data for (e.g., 'Apple Inc', 'Microsoft Corporation'). Must be 3-30 characters."},"required":true,"description":"Company name to retrieve brand data for (e.g., 'Apple Inc', 'Microsoft Corporation'). Must be 3-30 characters.","name":"name","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/SupportedLanguage"},{"type":["string","null"]}]},"required":false,"description":"Language to force for the retrieved brand data.","name":"force_language","in":"query"},{"schema":{"type":"boolean","default":false,"description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data."},"required":false,"description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data.","name":"maxSpeed","in":"query"},{"schema":{"$ref":"#/components/schemas/CountryGL"},"required":false,"description":"Two-letter ISO 3166-1 alpha-2 country code (GL parameter) used to localize search.","name":"country_gl","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":{"$ref":"#/components/schemas/BrandResponse"}}}},"400":{"description":"Bad Request - Invalid company name or company 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":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimited","description":"Response for status 429."},"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"}}}}},"operationId":"get_brand_retrieve_by_name"}},"/brand/search":{"get":{"summary":"Brand Search","description":"Search indexed brands by name or domain","security":[{"bearerAuth":[]}],"tags":["Brand Intelligence"],"x-mint":{"content":"<Badge color=\"blue\">Free on Pro and Scale</Badge><Badge color=\"orange\">1 Credit on Free and Starter</Badge>"},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"Search term, matched against the fields selected by queryBy (e.g. 'nike', 'nike.com', 'nik')."},"required":true,"description":"Search term, matched against the fields selected by queryBy (e.g. 'nike', 'nike.com', 'nik').","name":"query","in":"query"},{"schema":{"type":"boolean","default":true,"description":"Whether the search term matches by prefix, so partial words match as they are typed (e.g. 'nik' matches Nike). Set to false to match whole words only."},"required":false,"description":"Whether the search term matches by prefix, so partial words match as they are typed (e.g. 'nik' matches Nike). Set to false to match whole words only.","name":"autocomplete","in":"query"},{"schema":{"type":"array","items":{"type":"string","enum":["name","domain"]},"minItems":1,"default":["name","domain"],"description":"Fields to match the search term against, as a comma-separated list or repeated parameter: 'name', 'domain', or both. Defaults to both."},"required":false,"description":"Fields to match the search term against, as a comma-separated list or repeated parameter: 'name', 'domain', or both. Defaults to both.","name":"queryBy","in":"query"},{"schema":{"type":"integer","minimum":0,"maximum":2,"default":0,"description":"Maximum number of typos tolerated when matching, from 0 to 2. Defaults to 0 (no typo tolerance)."},"required":false,"description":"Maximum number of typos tolerated when matching, from 0 to 2. Defaults to 0 (no typo tolerance).","name":"typoTolerance","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":{"results":{"type":"array","maxItems":10,"description":"Up to 10 matching brands, name matches first, then domain matches, most popular first within each group. Empty when nothing matches.","items":{"type":"object","properties":{"domain":{"type":"string","description":"The brand's domain.","example":"nike.com"},"name":{"type":"string","description":"The brand's name. Empty string when unknown.","example":"Nike"},"logo":{"type":"string","description":"Logo link URL that serves the brand's logo, generated per request for the calling organization.","example":"https://logos.context.dev/?publicClientId=pub_1a2b3c&domain=nike.com"}},"required":["domain","name","logo"]}},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["results"]}}}},"400":{"description":"Bad Request - Invalid or missing search query","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 issue"},"error_code":{"type":"string","enum":["INPUT_VALIDATION_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"}}}}}},"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","description":"Response for status 429."},"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.brand.search({ query: 'x' });\n\nconsole.log(response.results);"},{"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.brand.search(\n    query=\"x\",\n)\nprint(response.results)"},{"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.Brand.Search(context.TODO(), contextdev.BrandSearchParams{\n\t\tQuery: \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Results)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.brand.search(query: \"x\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->brand->search(\n    query: 'x',\n    autocomplete: true,\n    queryBy: ['name'],\n    tags: ['production', 'team-alpha'],\n    typoTolerance: 0,\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev brand search \\\n  --api-key 'My API Key' \\\n  --query x"}],"operationId":"get_brand_search"}},"/brand/retrieve-by-email":{"get":{"x-hidden":true,"summary":"Retrieve brand data by email address","description":"Retrieve brand information using an email address while detecting disposable and free email addresses. Disposable and free email addresses (like gmail.com, yahoo.com) will throw a 422 error.","security":[{"bearerAuth":[]}],"tags":["Brand Intelligence"],"x-mint":{"content":"<Badge color=\"orange\">10 Credits</Badge>"},"parameters":[{"schema":{"type":"string","minLength":1,"format":"email","description":"Email address to retrieve brand data for (e.g., 'contact@example.com'). The domain will be extracted from the email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email addresses are not allowed."},"required":true,"description":"Email address to retrieve brand data for (e.g., 'contact@example.com'). The domain will be extracted from the email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email addresses are not allowed.","name":"email","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/SupportedLanguage"},{"type":["string","null"]}]},"required":false,"description":"Language to force for the retrieved brand data.","name":"force_language","in":"query"},{"schema":{"type":"boolean","default":false,"description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data."},"required":false,"description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data.","name":"maxSpeed","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":{"$ref":"#/components/schemas/BrandResponse"}}}},"400":{"description":"Bad Request - Invalid email or domain 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":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity - Free email or disposable email detected","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"},"status":{"type":"string","description":"Status of the response, e.g., 'error'"},"error_code":{"type":"string","enum":["FREE_EMAIL_DETECTED","DISPOSABLE_EMAIL_DETECTED"],"description":"Error code indicating whether a free email provider or disposable email was detected"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}}}}}},"429":{"$ref":"#/components/responses/RateLimited","description":"Response for status 429."},"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"}}}}},"operationId":"get_brand_retrieve_by_email"}},"/brand/retrieve-by-ticker":{"get":{"x-hidden":true,"summary":"Retrieve brand data by stock ticker","description":"Retrieve brand information using a stock ticker symbol.","security":[{"bearerAuth":[]}],"tags":["Brand Intelligence"],"x-mint":{"content":"<Badge color=\"orange\">10 Credits</Badge>"},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":15,"pattern":"^[A-Za-z0-9.]+$","description":"Stock ticker symbol to retrieve brand data for (e.g., 'AAPL', 'GOOGL', 'BRK.A'). Must be 1-15 characters, letters/numbers/dots only."},"required":true,"description":"Stock ticker symbol to retrieve brand data for (e.g., 'AAPL', 'GOOGL', 'BRK.A'). Must be 1-15 characters, letters/numbers/dots only.","name":"ticker","in":"query"},{"schema":{"$ref":"#/components/schemas/StockExchange"},"required":false,"description":"Stock exchange code.","name":"ticker_exchange","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/SupportedLanguage"},{"type":["string","null"]}]},"required":false,"description":"Language to force for the retrieved brand data.","name":"force_language","in":"query"},{"schema":{"type":"boolean","default":false,"description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data."},"required":false,"description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data.","name":"maxSpeed","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":{"$ref":"#/components/schemas/BrandResponse"}}}},"400":{"description":"Bad Request - Invalid ticker or ticker 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":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimited","description":"Response for status 429."},"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"}}}}},"operationId":"get_brand_retrieve_by_ticker"}},"/brand/retrieve-by-isin":{"get":{"x-hidden":true,"summary":"Retrieve brand data by ISIN","description":"Retrieve brand information using an ISIN (International Securities Identification Number). ","security":[{"bearerAuth":[]}],"tags":["Brand Intelligence"],"x-mint":{"content":"<Badge color=\"orange\">10 Credits</Badge>"},"parameters":[{"schema":{"type":"string","minLength":12,"maxLength":12,"pattern":"^[A-Z]{2}[A-Z0-9]{9}[0-9]$","description":"ISIN (International Securities Identification Number) to retrieve brand data for (e.g., 'AU000000IMD5', 'US0378331005'). Must be exactly 12 characters: 2 letters followed by 9 alphanumeric characters and ending with a digit."},"required":true,"description":"ISIN (International Securities Identification Number) to retrieve brand data for (e.g., 'AU000000IMD5', 'US0378331005'). Must be exactly 12 characters: 2 letters followed by 9 alphanumeric characters and ending with a digit.","name":"isin","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/SupportedLanguage"},{"type":["string","null"]}]},"required":false,"description":"Language to force for the retrieved brand data.","name":"force_language","in":"query"},{"schema":{"type":"boolean","default":false,"description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data."},"required":false,"description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data.","name":"maxSpeed","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":{"$ref":"#/components/schemas/BrandResponse"}}}},"400":{"description":"Bad Request - Invalid ISIN or ISIN 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":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"$ref":"#/components/responses/RateLimited","description":"Response for status 429."},"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"}}}}},"operationId":"get_brand_retrieve_by_isin"}},"/brand/transaction_identifier":{"get":{"x-hidden":true,"summary":"Identify brand from transaction data","description":"Endpoint specially designed for platforms that want to identify transaction data by the transaction title.","security":[{"bearerAuth":[]}],"tags":["Brand Intelligence"],"x-mint":{"content":"<Badge color=\"orange\">10 Credits</Badge>"},"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":500,"description":"Transaction information to identify the brand"},"required":true,"description":"Transaction information to identify the brand","name":"transaction_info","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/SupportedLanguage"},{"type":["string","null"]}]},"required":false,"description":"Language to force for the retrieved brand data.","name":"force_language","in":"query"},{"schema":{"type":"boolean","default":false,"description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data."},"required":false,"description":"Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data.","name":"maxSpeed","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":{"$ref":"#/components/schemas/CountryGL"},"required":false,"description":"Two-letter ISO 3166-1 alpha-2 country code (GL parameter) used to localize search.","name":"country_gl","in":"query"},{"schema":{"type":"string","description":"Optional city name to prioritize when searching for the brand."},"required":false,"description":"Optional city name to prioritize when searching for the brand.","name":"city","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Optional Merchant Category Code (MCC) to help identify the business category/industry."},"required":false,"description":"Optional Merchant Category Code (MCC) to help identify the business category/industry.","name":"mcc","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Optional phone number from the transaction to help verify brand match."},"required":false,"description":"Optional phone number from the transaction to help verify brand match.","name":"phone","in":"query"},{"schema":{"type":"boolean","default":false,"description":"When set to true, the API will perform an additional verification steps to ensure the identified brand matches the transaction with high confidence."},"required":false,"description":"When set to true, the API will perform an additional verification steps to ensure the identified brand matches the transaction with high confidence.","name":"high_confidence_only","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":{"$ref":"#/components/schemas/BrandResponse"}}}},"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"}}}}}},"429":{"$ref":"#/components/responses/RateLimited","description":"Response for status 429."}},"operationId":"get_brand_transaction_identifier"}},"/brand/retrieve-simplified":{"get":{"summary":"Retrieve simplified brand data by domain","description":"Returns a simplified version of brand data containing only essential information: domain, title, colors, logos, and backdrops. Optimized for faster responses and reduced data transfer.","security":[{"bearerAuth":[]}],"tags":["Brand Intelligence"],"x-mint":{"content":"<Badge color=\"orange\">10 Credits</Badge>"},"parameters":[{"schema":{"type":"string","minLength":3,"description":"Domain name to retrieve simplified brand data for"},"required":true,"description":"Domain name to retrieve simplified brand data for","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"},{"schema":{"type":"string","enum":["light","dark"],"description":"Optional theme preference used when selecting brand assets."},"required":false,"description":"Optional theme preference used when selecting brand assets.","name":"theme","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":{"$ref":"#/components/schemas/SimplifiedBrandResponse"}}}},"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","description":"Response for status 429."},"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"},"status":{"type":"string","description":"Status of the response, e.g., 'error'"},"error_code":{"type":"string","description":"Error code indicating the type of 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.brand.retrieveSimplified({ domain: 'xxx' });\n\nconsole.log(response.brand);"},{"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.brand.retrieve_simplified(\n    domain=\"xxx\",\n)\nprint(response.brand)"},{"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.Brand.GetSimplified(context.TODO(), contextdev.BrandGetSimplifiedParams{\n\t\tDomain: \"xxx\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Brand)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.brand.retrieve_simplified(domain: \"xxx\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->brand->retrieveSimplified(\n    domain: 'xxx',\n    maxAgeMs: 0,\n    tags: ['production', 'team-alpha'],\n    theme: 'light',\n    timeoutMs: 1000,\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev brand retrieve-simplified \\\n  --api-key 'My API Key' \\\n  --domain xxx"}],"operationId":"get_brand_retrieve_simplified"}},"/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. Values below 1 day are clamped to 1 day."},"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."},"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. Values below 1 day are clamped to 1 day."},"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":"<Badge color=\"orange\">10 Credits</Badge>","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","WEBSITE_BLOCKED","WEBSITE_NOT_FOUND","INPUT_VALIDATION_ERROR"],"description":"Error code indicating the type of error. WEBSITE_BLOCKED means the site answered with an anti-bot challenge or blocked automated access instead of the page — the request is not billed, and retrying later sometimes succeeds. WEBSITE_NOT_FOUND means the target page returned or fingerprinted as a 404."},"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","description":"Response for status 429."},"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\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.web.extract_styleguide\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->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'"}],"operationId":"get_web_styleguide"}},"/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":"<Badge color=\"orange\">5 Credits</Badge>","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","description":"Response for status 429."},"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\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.web.extract_fonts\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->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'"}],"operationId":"get_web_fonts"}},"/web/screenshot":{"get":{"summary":"Scrape Screenshot","description":"Capture a screenshot of a website.","x-oneOf-query":[{"title":"By Domain","required":["domain"],"properties":{"domain":{"type":"string","description":"Domain name to take screenshot of (e.g., 'example.com', 'google.com')."},"fullScreenshot":{"type":"string","enum":["true","false"]},"handleCookiePopup":{"type":"string","enum":["true","false"],"default":"false","description":"Optional parameter to control cookie/consent popup handling. If 'true', the browser service dismisses cookie consent before capture. If 'false' or omitted, captures without that step. "},"clearPopups":{"type":"string","enum":["true","false"],"default":"false","description":"Optional parameter for comprehensive popup cleanup. If 'true', the browser dismisses detected cookie/consent UI and clears other detected obstructive popups and overlays before capture. If 'false' or omitted, this parameter requests no cleanup; handleCookiePopup can still request cookie/consent handling independently."},"colorScheme":{"type":"string","enum":["light","dark"],"description":"Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances."},"viewport":{"type":"object","additionalProperties":false,"default":{"width":1920,"height":1080},"properties":{"width":{"type":"integer","minimum":240,"maximum":7680,"default":1920,"description":"Viewport width in pixels."},"height":{"type":"integer","minimum":240,"maximum":4320,"default":1080,"description":"Viewport height in pixels."}},"description":"Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080."},"maxAgeMs":{"type":"integer","minimum":0,"maximum":2592000000,"default":86400000,"description":"Return a cached screenshot if a prior screenshot for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh."},"page":{"type":"string","enum":["login","signup","blog","careers","pricing","terms","privacy","contact"]},"waitForMs":{"type":"integer","minimum":0,"maximum":30000,"default":3000,"description":"Optional browser wait time in milliseconds after initial page load before taking the screenshot. Min: 0. Max: 30000 (30 seconds).  Defaults to 3000 ms when omitted."},"country":{"$ref":"#/components/schemas/BrowserCountryCode"},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"}}},{"title":"By Direct URL","required":["directUrl"],"properties":{"directUrl":{"type":"string","format":"uri","description":"A specific URL to screenshot directly, bypassing domain resolution."},"fullScreenshot":{"type":"string","enum":["true","false"]},"handleCookiePopup":{"type":"string","enum":["true","false"],"default":"false","description":"Optional parameter to control cookie/consent popup handling. If 'true', the browser service dismisses cookie consent before capture. If 'false' or omitted, captures without that step. "},"clearPopups":{"type":"string","enum":["true","false"],"default":"false","description":"Optional parameter for comprehensive popup cleanup. If 'true', the browser dismisses detected cookie/consent UI and clears other detected obstructive popups and overlays before capture. If 'false' or omitted, this parameter requests no cleanup; handleCookiePopup can still request cookie/consent handling independently."},"colorScheme":{"type":"string","enum":["light","dark"],"description":"Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances."},"viewport":{"type":"object","additionalProperties":false,"default":{"width":1920,"height":1080},"properties":{"width":{"type":"integer","minimum":240,"maximum":7680,"default":1920,"description":"Viewport width in pixels."},"height":{"type":"integer","minimum":240,"maximum":4320,"default":1080,"description":"Viewport height in pixels."}},"description":"Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080."},"maxAgeMs":{"type":"integer","minimum":0,"maximum":2592000000,"default":86400000,"description":"Return a cached screenshot if a prior screenshot for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh."},"waitForMs":{"type":"integer","minimum":0,"maximum":30000,"default":3000,"description":"Optional browser wait time in milliseconds after initial page load before taking the screenshot. Min: 0. Max: 30000 (30 seconds).  Defaults to 3000 ms when omitted."},"country":{"$ref":"#/components/schemas/BrowserCountryCode"},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"}}}],"security":[{"bearerAuth":[]}],"tags":["Web Scraping"],"x-mint":{"content":"<Badge color=\"blue\">1 Credit</Badge>","title":"Scrape Screenshot","sidebarTitle":"Scrape screenshot","description":"Capture a screenshot of a website."},"parameters":[{"schema":{"type":"string","minLength":3,"description":"Domain name to take screenshot of (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 take screenshot of (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 screenshot directly, bypassing domain resolution (e.g., 'https://example.com/pricing'). When provided, the screenshot is taken of this exact URL. You must provide either 'domain' or 'directUrl', but not both."},"required":false,"description":"A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https://example.com/pricing'). When provided, the screenshot is taken of this exact URL. You must provide either 'domain' or 'directUrl', but not both.","name":"directUrl","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Optional parameter to determine screenshot type. If 'true', takes a full page screenshot capturing all content. If 'false' or not provided, takes a viewport screenshot (standard browser view)."},"required":false,"description":"Optional parameter to determine screenshot type. If 'true', takes a full page screenshot capturing all content. If 'false' or not provided, takes a viewport screenshot (standard browser view).","name":"fullScreenshot","in":"query"},{"schema":{"type":"string","enum":["login","signup","blog","careers","pricing","terms","privacy","contact"],"description":"Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported languages). If not provided, screenshots the main domain landing page. Only applicable when using 'domain', not 'directUrl'."},"required":false,"description":"Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported languages). If not provided, screenshots the main domain landing page. Only applicable when using 'domain', not 'directUrl'.","name":"page","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":30000,"default":3000,"description":"Optional browser wait time in milliseconds after initial page load before taking the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when omitted."},"required":false,"description":"Optional browser wait time in milliseconds after initial page load before taking the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when omitted.","name":"waitForMs","in":"query"},{"schema":{"type":"object","properties":{"width":{"type":"integer","minimum":240,"maximum":7680,"default":1920,"description":"Viewport width in pixels."},"height":{"type":"integer","minimum":240,"maximum":4320,"default":1080,"description":"Viewport height in pixels."}},"default":{"width":1920,"height":1080},"description":"Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080."},"required":false,"description":"Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.","name":"viewport","in":"query"},{"schema":{"type":"boolean","default":false,"description":"Optional parameter to control cookie/consent popup handling. If 'true', we dismiss cookie banner before capture. If 'false' or not provided, captures the page without that step."},"required":false,"description":"Optional parameter to control cookie/consent popup handling. If 'true', we dismiss cookie banner before capture. If 'false' or not provided, captures the page without that step.","name":"handleCookiePopup","in":"query"},{"schema":{"type":"boolean","default":false,"description":"Optional parameter for comprehensive popup cleanup. If 'true', the browser dismisses detected cookie/consent UI and clears other detected obstructive popups and overlays before capture. If 'false' or not provided, this parameter requests no cleanup; handleCookiePopup can still request cookie/consent handling independently."},"required":false,"description":"Optional parameter for comprehensive popup cleanup. If 'true', the browser dismisses detected cookie/consent UI and clears other detected obstructive popups and overlays before capture. If 'false' or not provided, this parameter requests no cleanup; handleCookiePopup can still request cookie/consent handling independently.","name":"clearPopups","in":"query"},{"schema":{"type":"string","enum":["light","dark"],"description":"Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances."},"required":false,"description":"Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances.","name":"colorScheme","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":100000,"description":"Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the returned image is the viewport-sized slice that begins at this Y offset (e.g. request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000."},"required":false,"description":"Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the returned image is the viewport-sized slice that begins at this Y offset (e.g. request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000.","name":"scrollOffset","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":2592000000,"default":86400000,"description":"Return a cached screenshot if a prior screenshot for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh."},"required":false,"description":"Return a cached screenshot if a prior screenshot for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.","name":"maxAgeMs","in":"query"},{"schema":{"$ref":"#/components/schemas/BrowserCountryCode"},"required":false,"description":"Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).","name":"country","in":"query"},{"schema":{"$ref":"#/components/schemas/LenientTimeoutMS"},"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":["enabled","disabled"],"default":"disabled","description":"Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true."},"required":false,"description":"Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.","name":"zdr","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"},"X-Context-ZDR":{"description":"Present with the value true when zero data retention was requested and honored.","schema":{"type":"string","enum":["true"]}}},"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"},"screenshot":{"type":"string","description":"Public image URL for standard requests, or an in-memory data URL when ZDR is enabled."},"screenshotType":{"type":"string","enum":["viewport","fullPage"],"description":"Type of screenshot that was captured"},"width":{"type":"integer","description":"Width in pixels of the returned screenshot image"},"height":{"type":"integer","description":"Height in pixels of the returned screenshot image"},"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"}}}}}},"429":{"$ref":"#/components/responses/RateLimited","description":"Response for status 429."},"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.screenshot();\n\nconsole.log(response.width);"},{"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.screenshot()\nprint(response.width)"},{"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.Screenshot(context.TODO(), contextdev.WebScreenshotParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Width)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.web.screenshot\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->web->screenshot(\n    clearPopups: true,\n    colorScheme: 'light',\n    country: 'de',\n    directURL: 'https://example.com',\n    domain: 'xxx',\n    fullScreenshot: 'true',\n    handleCookiePopup: true,\n    maxAgeMs: 0,\n    page: 'login',\n    scrollOffset: 0,\n    tags: ['production', 'team-alpha'],\n    timeoutMs: 1,\n    viewport: ['height' => 240, 'width' => 240],\n    waitForMs: 0,\n    zdr: 'enabled',\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev web screenshot \\\n  --api-key 'My API Key'"}],"operationId":"get_web_screenshot"}},"/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":"<Badge color=\"orange\">10 Credits</Badge>","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","description":"Response for status 429."}},"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\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.industry.retrieve_naics(input: \"xxxx\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->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"}],"operationId":"get_web_naics"}},"/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":"<Badge color=\"orange\">10 Credits</Badge>","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","description":"Response for status 429."}},"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\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.industry.retrieve_sic(input: \"xxxx\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->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"}],"operationId":"get_web_sic"}},"/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":"<Badge color=\"orange\">10 Credits</Badge>"},"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","description":"Response for status 429."},"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"}}}}}}},"operationId":"post_brand_ai_query"}},"/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":"<Badge color=\"orange\">10 Credits</Badge>"},"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"},"regular_price":{"type":["number","null"],"description":"Original or regular price before a displayed discount"},"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"},"availability":{"type":["string","null"],"enum":["in_stock","out_of_stock","limited_availability","preorder","backorder","made_to_order","discontinued",null],"description":"Normalized stock or ordering availability"},"dimensions":{"type":"array","description":"Dimension statements shown for the product, preserving labels, values, and units","items":{"type":"string"}},"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","description":"Response for status 429."},"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\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.ai.extract_product(url: \"https://example.com\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->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"}],"operationId":"post_brand_ai_product"}},"/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":"<Badge color=\"orange\">10 Credits</Badge> <Badge color=\"purple\">Beta Feature</Badge>"},"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"},"regular_price":{"type":["number","null"],"description":"Original or regular price before a displayed discount"},"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"},"availability":{"type":["string","null"],"enum":["in_stock","out_of_stock","limited_availability","preorder","backorder","made_to_order","discontinued",null],"description":"Normalized stock or ordering availability"},"dimensions":{"type":"array","description":"Dimension statements shown for the product, preserving labels, values, and units","items":{"type":"string"}},"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","description":"Response for status 429."},"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\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.ai.extract_products(body: {domain: \"domain\"})\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->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"}],"operationId":"post_brand_ai_products"}},"/brand/prefetch":{"post":{"x-hidden":true,"summary":"Prefetch brand data for a domain","description":"Signal that you may fetch brand data for a particular domain soon to improve latency.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","description":"Domain name to prefetch brand data for"},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"tags":{"$ref":"#/components/schemas/RequestTags"}}}}}},"security":[{"bearerAuth":[]}],"tags":["Utility"],"x-mint":{"content":"<Badge color=\"green\">0 Credits</Badge> <Badge color=\"purple\">Only for Subscribers</Badge>"},"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'"},"message":{"type":"string","description":"Success message"},"domain":{"type":"string","description":"The domain that was queued for prefetching"},"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"}}}}}},"403":{"description":"Forbidden - Paid subscription required","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"},"status":{"type":"string","description":"Status of the response, e.g., 'error'"},"error_code":{"type":"string","enum":["FORBIDDEN"],"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","description":"Response for status 429."},"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"}}}}}}},"operationId":"post_brand_prefetch"}},"/brand/prefetch-by-email":{"post":{"x-hidden":true,"summary":"Prefetch brand data by email","description":"Signal that you may fetch brand data for a particular domain soon to improve latency. This endpoint accepts an email address, extracts the domain from it, validates that it's not a disposable or free email provider, and queues the domain for prefetching.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","description":"Email address to prefetch brand data for. The domain will be extracted from the email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email addresses are not allowed."},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"tags":{"$ref":"#/components/schemas/RequestTags"}}}}}},"security":[{"bearerAuth":[]}],"tags":["Utility"],"x-mint":{"content":"<Badge color=\"green\">0 Credits</Badge> <Badge color=\"purple\">Only for Subscribers</Badge>"},"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'"},"message":{"type":"string","description":"Success message"},"domain":{"type":"string","description":"The domain that was queued for prefetching"},"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"}}}}}},"403":{"description":"Forbidden - Paid subscription required","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"},"status":{"type":"string","description":"Status of the response, e.g., 'error'"},"error_code":{"type":"string","enum":["FORBIDDEN"],"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"}}}}}},"422":{"description":"Unprocessable Entity - Free email or disposable email detected","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"},"status":{"type":"string","description":"Status of the response, e.g., 'error'"},"error_code":{"type":"string","enum":["FREE_EMAIL_DETECTED","DISPOSABLE_EMAIL_DETECTED"],"description":"Error code indicating whether a free email provider or disposable email was detected"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}}}}}},"429":{"$ref":"#/components/responses/RateLimited","description":"Response for status 429."},"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"}}}}}}},"operationId":"post_brand_prefetch_by_email"}},"/utility/prefetch":{"post":{"summary":"Prefetch data","description":"Signal that you may fetch data soon to improve latency. The type field selects what to prefetch ('brand' queues a brand data fetch, 'styleguide' queues a styleguide extraction) and identifier carries exactly one lookup key: a domain, or an email whose domain is extracted and validated (free email providers and disposable email addresses are not allowed).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","identifier"],"properties":{"type":{"type":"string","enum":["brand","styleguide"],"description":"What to prefetch: 'brand' warms the brand data cache, 'styleguide' warms the styleguide cache."},"identifier":{"$ref":"#/components/schemas/UtilityPrefetchIdentifier"},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"tags":{"$ref":"#/components/schemas/RequestTags"}}}}}},"security":[{"bearerAuth":[]}],"tags":["Utility"],"x-mint":{"content":"<Badge color=\"green\">0 Credits</Badge> <Badge color=\"purple\">Only for Subscribers</Badge>"},"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'"},"message":{"type":"string","description":"Success message"},"type":{"type":"string","enum":["brand","styleguide"],"description":"The type of prefetch that was queued, echoed from the request"},"domain":{"type":"string","description":"The domain that was queued for prefetching"},"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"}}}}}},"403":{"description":"Forbidden - Paid subscription required","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"},"status":{"type":"string","description":"Status of the response, e.g., 'error'"},"error_code":{"type":"string","enum":["FORBIDDEN"],"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"}}}}}},"422":{"description":"Unprocessable Entity - Free email or disposable email detected","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"},"status":{"type":"string","description":"Status of the response, e.g., 'error'"},"error_code":{"type":"string","enum":["FREE_EMAIL_DETECTED","DISPOSABLE_EMAIL_DETECTED"],"description":"Error code indicating whether a free email provider or disposable email was detected"},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}}}}}},"429":{"$ref":"#/components/responses/RateLimited","description":"Response for status 429."},"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.utility.prefetch({\n  identifier: { domain: 'xxx' },\n  type: 'brand',\n});\n\nconsole.log(response.domain);"},{"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.utility.prefetch(\n    identifier={\n        \"domain\": \"xxx\"\n    },\n    type=\"brand\",\n)\nprint(response.domain)"},{"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.Utility.Prefetch(context.TODO(), contextdev.UtilityPrefetchParams{\n\t\tIdentifier: contextdev.UtilityPrefetchParamsIdentifierUnion{\n\t\t\tOfByDomain: &contextdev.UtilityPrefetchParamsIdentifierByDomain{\n\t\t\t\tDomain: \"xxx\",\n\t\t\t},\n\t\t},\n\t\tType: contextdev.UtilityPrefetchParamsTypeBrand,\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Domain)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.utility.prefetch(identifier: {domain: \"xxx\"}, type: :brand)\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->utility->prefetch(\n    identifier: ['domain' => 'xxx'],\n    type: 'brand',\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 utility prefetch \\\n  --api-key 'My API Key' \\\n  --identifier '{domain: xxx}' \\\n  --type brand"}],"operationId":"post_utility_prefetch"}},"/monitors":{"post":{"summary":"Create a monitor","description":"Creates a monitor. The request body is a union of the supported target/change detection combinations. The monitor runs immediately after creation to create its initial baseline.","operationId":"createMonitor","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorsCreateMonitorRequest"},"examples":{"page_exact":{"summary":"Exact page monitor","value":{"mode":"web","name":"Acme pricing page","target":{"type":"page","url":"https://acme.com/pricing"},"change_detection":{"type":"exact"},"schedule":{"type":"interval","frequency":6,"unit":"hours"},"webhook":{"url":"https://example.com/webhook"}}},"sitemap_exact":{"summary":"Exact sitemap monitor","value":{"mode":"web","name":"Acme sitemap","target":{"type":"sitemap","url":"https://acme.com/sitemap.xml"},"change_detection":{"type":"exact"},"schedule":{"type":"interval","frequency":1,"unit":"days"},"webhook":{"url":"https://example.com/webhook"}}},"extract_semantic":{"summary":"Semantic extract monitor","value":{"mode":"web","name":"Acme website positioning","target":{"type":"extract","url":"https://acme.com","instructions":"Extract the product positioning, pricing, packaging, and headline feature claims.","max_pages":10},"change_detection":{"type":"semantic"},"schedule":{"type":"interval","frequency":1,"unit":"days"},"webhook":{"url":"https://example.com/webhook"}}}}}}},"security":[{"bearerAuth":[]}],"tags":["Monitors"],"responses":{"201":{"description":"Monitor created","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/MonitorsCreateMonitorResponse"}}}},"400":{"$ref":"#/components/responses/MonitorsBadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."},"403":{"$ref":"#/components/responses/MonitorsLimitExceeded","description":"Response for status 403."}},"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 monitor = await client.monitors.create({\n  name: 'Acme pricing page',\n  target: { type: 'page', url: 'https://acme.com/pricing' },\n  change_detection: { type: 'exact' },\n  mode: 'web',\n  schedule: {\n    type: 'interval',\n    frequency: 6,\n    unit: 'hours',\n  },\n  webhook: { url: 'https://example.com/webhook' },\n});\n\nconsole.log(monitor.id);"},{"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)\nmonitor = client.monitors.create(\n    name=\"Acme pricing page\",\n    target={\n        \"type\": \"page\",\n        \"url\": \"https://acme.com/pricing\",\n    },\n    change_detection={\n        \"type\": \"exact\"\n    },\n    mode=\"web\",\n    schedule={\n        \"type\": \"interval\",\n        \"frequency\": 6,\n        \"unit\": \"hours\",\n    },\n    webhook={\n        \"url\": \"https://example.com/webhook\"\n    },\n)\nprint(monitor.id)"},{"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\tmonitor, err := client.Monitors.New(context.TODO(), contextdev.MonitorNewParams{\n\t\tName: \"Acme pricing page\",\n\t\tTarget: contextdev.MonitorNewParamsTargetUnion{\n\t\t\tOfPage: &contextdev.MonitorNewParamsTargetPage{\n\t\t\t\tURL: \"https://acme.com/pricing\",\n\t\t\t},\n\t\t},\n\t\tChangeDetection: contextdev.MonitorNewParamsChangeDetectionUnion{\n\t\t\tOfExact: &contextdev.MonitorNewParamsChangeDetectionExact{},\n\t\t},\n\t\tMode: contextdev.MonitorNewParamsModeWeb,\n\t\tSchedule: contextdev.MonitorNewParamsSchedule{\n\t\t\tType:      \"interval\",\n\t\t\tFrequency: 6,\n\t\t\tUnit:      \"hours\",\n\t\t},\n\t\tWebhook: contextdev.MonitorNewParamsWebhook{\n\t\t\tURL: \"https://example.com/webhook\",\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", monitor.ID)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nmonitor = context_dev.monitors.create(\n  name: \"Acme pricing page\",\n  target: {type: :page, url: \"https://acme.com/pricing\"}\n)\n\nputs(monitor)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $monitor = $client->monitors->create(\n    name: 'Acme pricing page',\n    target: [\n      'type' => 'page',\n      'url' => 'https://acme.com/pricing',\n      'instructions' => 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.',\n      'normalizeWhitespace' => true,\n    ],\n    changeDetection: ['type' => 'exact'],\n    mode: 'web',\n    schedule: ['frequency' => 6, 'type' => 'interval', 'unit' => 'hours'],\n    tags: ['pricing', 'competitor'],\n    webhook: [\n      'url' => 'https://example.com/webhook',\n      'events' => ['change.detected', 'run.completed'],\n    ],\n  );\n\n  var_dump($monitor);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors create \\\n  --api-key 'My API Key' \\\n  --name 'Acme pricing page' \\\n  --target '{type: page, url: https://acme.com/pricing}'"}]},"get":{"summary":"List monitors","description":"Lists monitors for the authenticated organization. Supports free-text search (`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus status/type/tag filters. Results are paginated via the opaque `cursor`.","operationId":"listMonitors","security":[{"bearerAuth":[]}],"tags":["Monitors"],"parameters":[{"schema":{"type":"string","maxLength":200,"description":"Free-text search term, matched against the fields named in `search_by`.","example":"pricing"},"required":false,"description":"Free-text search term, matched against the fields named in `search_by`.","name":"q","in":"query"},{"schema":{"type":["array","null"],"items":{"type":"string","enum":["name","url","instructions","tags"]},"description":"Comma-separated fields to search with `q`. Defaults to all of them. Note `instructions` only exists on extract monitors.","example":"name,url"},"required":false,"description":"Comma-separated fields to search with `q`. Defaults to all of them. Note `instructions` only exists on extract monitors.","name":"search_by","in":"query"},{"schema":{"type":"string","enum":["exact","prefix"],"description":"`prefix` for as-you-type prefix matching (default), `exact` for full-token matching."},"required":false,"description":"`prefix` for as-you-type prefix matching (default), `exact` for full-token matching.","name":"search_type","in":"query"},{"schema":{"type":"string","enum":["active","paused","failed"],"description":"Filter monitors by lifecycle status."},"required":false,"description":"Filter monitors by lifecycle status.","name":"status","in":"query"},{"schema":{"type":"string","enum":["page","sitemap","extract"],"description":"Filter by target type."},"required":false,"description":"Filter by target type.","name":"target_type","in":"query"},{"schema":{"type":"string","enum":["exact","semantic"],"description":"Filter by change detection type."},"required":false,"description":"Filter by change detection type.","name":"change_detection_type","in":"query"},{"schema":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20,"description":"Comma-separated list of tags to filter by (matches monitors having any of them).","example":"pricing,competitor"},"required":false,"description":"Comma-separated list of tags to filter by (matches monitors having any of them).","name":"tags","in":"query"},{"schema":{"type":"string","description":"Filter to items that have this tag.","example":"pricing"},"required":false,"description":"Filter to items that have this tag.","name":"tag","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum number of items to return per page (1-100). Defaults to 25."},"required":false,"description":"Maximum number of items to return per page (1-100). Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque pagination cursor from a previous response."},"required":false,"description":"Opaque pagination cursor from a previous response.","name":"cursor","in":"query"}],"responses":{"200":{"description":"A paginated list of monitors","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/MonitorsListMonitorsResponse"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."}},"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 monitors = await client.monitors.list();\n\nconsole.log(monitors.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)\nmonitors = client.monitors.list()\nprint(monitors.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\tmonitors, err := client.Monitors.List(context.TODO(), contextdev.MonitorListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", monitors.Data)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nmonitors = context_dev.monitors.list\n\nputs(monitors)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $monitors = $client->monitors->list(\n    changeDetectionType: 'exact',\n    cursor: 'cursor',\n    limit: 1,\n    q: 'pricing',\n    searchBy: ['name'],\n    searchType: 'exact',\n    status: 'active',\n    tag: 'pricing',\n    tags: ['x'],\n    targetType: 'page',\n  );\n\n  var_dump($monitors);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors list \\\n  --api-key 'My API Key'"}]}},"/monitors/{monitor_id}":{"get":{"summary":"Get a monitor","operationId":"getMonitor","security":[{"bearerAuth":[]}],"tags":["Monitors"],"parameters":[{"schema":{"type":"string","example":"mon_123"},"required":true,"name":"monitor_id","in":"path","description":"The `monitor_id` path parameter."}],"responses":{"200":{"description":"Monitor","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/MonitorsMonitor"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/MonitorsNotFound","description":"Response for status 404."}},"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 monitor = await client.monitors.retrieve('mon_123');\n\nconsole.log(monitor.id);"},{"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)\nmonitor = client.monitors.retrieve(\n    \"mon_123\",\n)\nprint(monitor.id)"},{"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\tmonitor, err := client.Monitors.Get(context.TODO(), \"mon_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", monitor.ID)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nmonitor = context_dev.monitors.retrieve(\"mon_123\")\n\nputs(monitor)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $monitor = $client->monitors->retrieve('mon_123');\n\n  var_dump($monitor);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors retrieve \\\n  --api-key 'My API Key' \\\n  --monitor-id mon_123"}],"description":"Get a monitor"},"patch":{"summary":"Update a monitor","description":"Updates a monitor. If `target` or `change_detection` changes, the monitor creates a new baseline. Unsupported target/change detection combinations are rejected.","operationId":"updateMonitor","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorsUpdateMonitorRequest"},"example":{"name":"Acme pricing monitor","status":"active","schedule":{"type":"interval","frequency":1,"unit":"hours"},"webhook":{"url":"https://example.com/webhook"}}}}},"security":[{"bearerAuth":[]}],"tags":["Monitors"],"parameters":[{"schema":{"type":"string","example":"mon_123"},"required":true,"name":"monitor_id","in":"path","description":"The `monitor_id` path parameter."}],"responses":{"200":{"description":"Updated monitor","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/MonitorsMonitor"}}}},"400":{"$ref":"#/components/responses/MonitorsBadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/MonitorsNotFound","description":"Response for status 404."}},"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 monitor = await client.monitors.update('mon_123', {\n  name: 'Acme pricing monitor',\n  schedule: {\n    type: 'interval',\n    frequency: 1,\n    unit: 'hours',\n  },\n  status: 'active',\n  webhook: { url: 'https://example.com/webhook' },\n});\n\nconsole.log(monitor.id);"},{"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)\nmonitor = client.monitors.update(\n    monitor_id=\"mon_123\",\n    name=\"Acme pricing monitor\",\n    schedule={\n        \"type\": \"interval\",\n        \"frequency\": 1,\n        \"unit\": \"hours\",\n    },\n    status=\"active\",\n    webhook={\n        \"url\": \"https://example.com/webhook\"\n    },\n)\nprint(monitor.id)"},{"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\tmonitor, err := client.Monitors.Update(\n\t\tcontext.TODO(),\n\t\t\"mon_123\",\n\t\tcontextdev.MonitorUpdateParams{\n\t\t\tName: contextdev.String(\"Acme pricing monitor\"),\n\t\t\tSchedule: contextdev.MonitorUpdateParamsSchedule{\n\t\t\t\tType:      \"interval\",\n\t\t\t\tFrequency: 1,\n\t\t\t\tUnit:      \"hours\",\n\t\t\t},\n\t\t\tStatus: contextdev.MonitorUpdateParamsStatusActive,\n\t\t\tWebhook: contextdev.MonitorUpdateParamsWebhook{\n\t\t\t\tURL: \"https://example.com/webhook\",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", monitor.ID)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nmonitor = context_dev.monitors.update(\"mon_123\")\n\nputs(monitor)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $monitor = $client->monitors->update(\n    'mon_123',\n    changeDetection: ['type' => 'exact'],\n    name: 'Acme pricing monitor',\n    schedule: ['frequency' => 1, 'type' => 'interval', 'unit' => 'hours'],\n    status: 'active',\n    tags: ['pricing', 'competitor'],\n    target: [\n      'type' => 'page',\n      'url' => 'https://acme.com/pricing',\n      'instructions' => 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.',\n      'normalizeWhitespace' => true,\n    ],\n    webhook: [\n      'url' => 'https://example.com/webhook',\n      'events' => ['change.detected', 'run.completed'],\n    ],\n  );\n\n  var_dump($monitor);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors update \\\n  --api-key 'My API Key' \\\n  --monitor-id mon_123"}]},"delete":{"summary":"Delete a monitor","operationId":"deleteMonitor","security":[{"bearerAuth":[]}],"tags":["Monitors"],"parameters":[{"schema":{"type":"string","example":"mon_123"},"required":true,"name":"monitor_id","in":"path","description":"The `monitor_id` path parameter."}],"responses":{"200":{"description":"Monitor deleted","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/MonitorsDeleteMonitorResponse"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/MonitorsNotFound","description":"Response for status 404."}},"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 monitor = await client.monitors.delete('mon_123');\n\nconsole.log(monitor.id);"},{"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)\nmonitor = client.monitors.delete(\n    \"mon_123\",\n)\nprint(monitor.id)"},{"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\tmonitor, err := client.Monitors.Delete(context.TODO(), \"mon_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", monitor.ID)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nmonitor = context_dev.monitors.delete(\"mon_123\")\n\nputs(monitor)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $monitor = $client->monitors->delete('mon_123');\n\n  var_dump($monitor);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors delete \\\n  --api-key 'My API Key' \\\n  --monitor-id mon_123"}],"description":"Delete a monitor"}},"/monitors/{monitor_id}/runs":{"get":{"summary":"List monitor runs","operationId":"listMonitorRuns","security":[{"bearerAuth":[]}],"tags":["Monitors"],"parameters":[{"schema":{"type":"string","example":"mon_123"},"required":true,"name":"monitor_id","in":"path","description":"The `monitor_id` path parameter."},{"schema":{"type":"string","enum":["queued","running","completed","failed","skipped"],"description":"Filter runs by lifecycle status."},"required":false,"description":"Filter runs by lifecycle status.","name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum number of items to return per page (1-100). Defaults to 25."},"required":false,"description":"Maximum number of items to return per page (1-100). Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque pagination cursor from a previous response."},"required":false,"description":"Opaque pagination cursor from a previous response.","name":"cursor","in":"query"}],"responses":{"200":{"description":"A paginated list of runs for the monitor","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/MonitorsListRunsResponse"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/MonitorsNotFound","description":"Response for status 404."}},"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.monitors.listRuns('mon_123');\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.monitors.list_runs(\n    monitor_id=\"mon_123\",\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.Monitors.ListRuns(\n\t\tcontext.TODO(),\n\t\t\"mon_123\",\n\t\tcontextdev.MonitorListRunsParams{},\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.monitors.list_runs(\"mon_123\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->monitors->listRuns(\n    'mon_123', cursor: 'cursor', limit: 1, status: 'queued'\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors list-runs \\\n  --api-key 'My API Key' \\\n  --monitor-id mon_123"}],"description":"List monitor runs"}},"/monitors/{monitor_id}/runs/{run_id}":{"get":{"summary":"Retrieve a monitor run","description":"Fetches one run for a monitor, including lifecycle status, timing, credits charged, and any detected change.","operationId":"getMonitorRun","security":[{"bearerAuth":[]}],"tags":["Monitors"],"x-mint":{"content":"<Badge color=\"green\">0 Credits</Badge>"},"parameters":[{"schema":{"type":"string","example":"mon_123"},"required":true,"name":"monitor_id","in":"path","description":"The `monitor_id` path parameter."},{"schema":{"type":"string","example":"run_123"},"required":true,"name":"run_id","in":"path","description":"The `run_id` path parameter."}],"responses":{"200":{"description":"The requested monitor run","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/MonitorsRun"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/MonitorsNotFound","description":"Response for status 404."}}}},"/monitors/{monitor_id}/changes":{"get":{"summary":"List changes for a monitor","operationId":"listMonitorChanges","security":[{"bearerAuth":[]}],"tags":["Monitors"],"parameters":[{"schema":{"type":"string","example":"mon_123"},"required":true,"name":"monitor_id","in":"path","description":"The `monitor_id` path parameter."},{"schema":{"type":"string","description":"Filter to items that have this tag.","example":"pricing"},"required":false,"description":"Filter to items that have this tag.","name":"tag","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only include items at or after this ISO 8601 timestamp.","example":"2026-06-01T00:00:00Z"},"required":false,"description":"Only include items at or after this ISO 8601 timestamp.","name":"since","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only include items before this ISO 8601 timestamp.","example":"2026-06-28T00:00:00Z"},"required":false,"description":"Only include items before this ISO 8601 timestamp.","name":"until","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum number of items to return per page (1-100). Defaults to 25."},"required":false,"description":"Maximum number of items to return per page (1-100). Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque pagination cursor from a previous response."},"required":false,"description":"Opaque pagination cursor from a previous response.","name":"cursor","in":"query"}],"responses":{"200":{"description":"A paginated list of changes for the monitor","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/MonitorsListChangesResponse"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/MonitorsNotFound","description":"Response for status 404."}},"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.monitors.listChanges('mon_123');\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.monitors.list_changes(\n    monitor_id=\"mon_123\",\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.Monitors.ListChanges(\n\t\tcontext.TODO(),\n\t\t\"mon_123\",\n\t\tcontextdev.MonitorListChangesParams{},\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.monitors.list_changes(\"mon_123\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->monitors->listChanges(\n    'mon_123',\n    cursor: 'cursor',\n    limit: 1,\n    since: new \\DateTimeImmutable('2026-06-01T00:00:00Z'),\n    tag: 'pricing',\n    until: new \\DateTimeImmutable('2026-06-28T00:00:00Z'),\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors list-changes \\\n  --api-key 'My API Key' \\\n  --monitor-id mon_123"}],"description":"List changes for a monitor"}},"/monitors/runs":{"get":{"summary":"List runs","description":"Returns an account-wide feed of monitor runs across all monitors.","operationId":"listAccountRuns","tags":["Monitors"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["queued","running","completed","failed","skipped"],"description":"Filter runs by lifecycle status."},"required":false,"description":"Filter runs by lifecycle status.","name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum number of items to return per page (1-100). Defaults to 25."},"required":false,"description":"Maximum number of items to return per page (1-100). Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque pagination cursor from a previous response."},"required":false,"description":"Opaque pagination cursor from a previous response.","name":"cursor","in":"query"}],"responses":{"200":{"description":"A paginated list of runs","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/MonitorsListRunsResponse"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."}},"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.monitors.listAccountRuns();\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.monitors.list_account_runs()\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.Monitors.ListAccountRuns(context.TODO(), contextdev.MonitorListAccountRunsParams{})\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.monitors.list_account_runs\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->monitors->listAccountRuns(\n    cursor: 'cursor', limit: 1, status: 'queued'\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors list-account-runs \\\n  --api-key 'My API Key'"}]}},"/monitors/credit-usage":{"get":{"summary":"Monitor credit usage","description":"Returns credits charged per monitor over an optional [since, until] window, newest spenders first.","operationId":"listMonitorCreditUsage","tags":["Monitors"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"date-time","description":"Only include items at or after this ISO 8601 timestamp.","example":"2026-06-01T00:00:00Z"},"required":false,"description":"Only include items at or after this ISO 8601 timestamp.","name":"since","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only include items before this ISO 8601 timestamp.","example":"2026-06-28T00:00:00Z"},"required":false,"description":"Only include items before this ISO 8601 timestamp.","name":"until","in":"query"}],"responses":{"200":{"description":"Per-monitor credit usage","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/MonitorsCreditUsageResponse"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."}},"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.monitors.getCreditUsage();\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.monitors.get_credit_usage()\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.Monitors.GetCreditUsage(context.TODO(), contextdev.MonitorGetCreditUsageParams{})\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.monitors.get_credit_usage\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->monitors->getCreditUsage(\n    since: new \\DateTimeImmutable('2026-06-01T00:00:00Z'),\n    until: new \\DateTimeImmutable('2026-06-28T00:00:00Z'),\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors get-credit-usage \\\n  --api-key 'My API Key'"}]}},"/monitors/limits":{"get":{"summary":"Monitor limits","description":"Returns how many monitors the account has and the maximum it allows.","operationId":"getMonitorLimits","tags":["Monitors"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Monitor usage and plan limit","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/MonitorsLimitsResponse"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."}},"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.monitors.getLimits();\n\nconsole.log(response.monitors_limit);"},{"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.monitors.get_limits()\nprint(response.monitors_limit)"},{"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.Monitors.GetLimits(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.MonitorsLimit)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.monitors.get_limits\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->monitors->getLimits();\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors get-limits \\\n  --api-key 'My API Key'"}]}},"/monitors/changes":{"get":{"summary":"List changes","description":"Returns an account-wide feed of detected changes across monitors.","operationId":"listChanges","security":[{"bearerAuth":[]}],"tags":["Monitors"],"parameters":[{"schema":{"type":"string","description":"Filter changes to a single monitor.","example":"mon_123"},"required":false,"description":"Filter changes to a single monitor.","name":"monitor_id","in":"query"},{"schema":{"type":"string","enum":["page","sitemap","extract"],"description":"Filter by target type."},"required":false,"description":"Filter by target type.","name":"target_type","in":"query"},{"schema":{"type":"string","enum":["exact","semantic"],"description":"Filter by change detection type."},"required":false,"description":"Filter by change detection type.","name":"change_detection_type","in":"query"},{"schema":{"type":"string","description":"Filter to items that have this tag.","example":"pricing"},"required":false,"description":"Filter to items that have this tag.","name":"tag","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only include items at or after this ISO 8601 timestamp.","example":"2026-06-01T00:00:00Z"},"required":false,"description":"Only include items at or after this ISO 8601 timestamp.","name":"since","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only include items before this ISO 8601 timestamp.","example":"2026-06-28T00:00:00Z"},"required":false,"description":"Only include items before this ISO 8601 timestamp.","name":"until","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum number of items to return per page (1-100). Defaults to 25."},"required":false,"description":"Maximum number of items to return per page (1-100). Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque pagination cursor from a previous response."},"required":false,"description":"Opaque pagination cursor from a previous response.","name":"cursor","in":"query"}],"responses":{"200":{"description":"A paginated list of changes","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/MonitorsListChangesResponse"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."}},"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.monitors.listAccountChanges();\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.monitors.list_account_changes()\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.Monitors.ListAccountChanges(context.TODO(), contextdev.MonitorListAccountChangesParams{})\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.monitors.list_account_changes\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->monitors->listAccountChanges(\n    changeDetectionType: 'exact',\n    cursor: 'cursor',\n    limit: 1,\n    monitorID: 'mon_123',\n    since: new \\DateTimeImmutable('2026-06-01T00:00:00Z'),\n    tag: 'pricing',\n    targetType: 'page',\n    until: new \\DateTimeImmutable('2026-06-28T00:00:00Z'),\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors list-account-changes \\\n  --api-key 'My API Key'"}]}},"/monitors/changes/{change_id}":{"get":{"summary":"Get a change","operationId":"getChange","security":[{"bearerAuth":[]}],"tags":["Monitors"],"parameters":[{"schema":{"type":"string","example":"chg_123"},"required":true,"name":"change_id","in":"path","description":"The `change_id` path parameter."}],"responses":{"200":{"description":"Change details","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/MonitorsChange"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/MonitorsNotFound","description":"Response for status 404."}},"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.monitors.retrieveChange('chg_123');\n\nconsole.log(response.id);"},{"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.monitors.retrieve_change(\n    \"chg_123\",\n)\nprint(response.id)"},{"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.Monitors.GetChange(context.TODO(), \"chg_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.ID)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.monitors.retrieve_change(\"chg_123\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->monitors->retrieveChange('chg_123');\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors retrieve-change \\\n  --api-key 'My API Key' \\\n  --change-id chg_123"}],"description":"Get a change"}},"/monitors/{monitor_id}/run":{"post":{"summary":"Run a monitor now","description":"Triggers an immediate run of the monitor outside its normal schedule. The run is queued and processed asynchronously.","operationId":"runMonitorNow","tags":["Monitors"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","example":"mon_123"},"required":true,"name":"monitor_id","in":"path","description":"The `monitor_id` path parameter."}],"responses":{"202":{"description":"Run queued","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/MonitorsRunNowResponse"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/MonitorsNotFound","description":"Response for status 404."}},"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.monitors.run('mon_123');\n\nconsole.log(response.monitor_id);"},{"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.monitors.run(\n    \"mon_123\",\n)\nprint(response.monitor_id)"},{"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.Monitors.Run(context.TODO(), \"mon_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.MonitorID)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.monitors.run(\"mon_123\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->monitors->run('mon_123');\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev monitors run \\\n  --api-key 'My API Key' \\\n  --monitor-id mon_123"}]}},"/monitors/{monitor_id}/webhook/rotate-secret":{"post":{"summary":"Rotate a monitor webhook secret","description":"Generates a new signing secret for the monitor's webhook and returns the updated monitor (including the new `webhook.secret`). The previous secret stops signing deliveries immediately, so update your endpoint before rotating.","operationId":"rotateMonitorWebhookSecret","tags":["Monitors"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","example":"mon_123"},"required":true,"name":"monitor_id","in":"path","description":"The `monitor_id` path parameter."}],"responses":{"200":{"description":"Monitor with the rotated webhook secret","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/MonitorsMonitor"}}}},"401":{"$ref":"#/components/responses/MonitorsUnauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/MonitorsNotFound","description":"Response for status 404."},"409":{"$ref":"#/components/responses/MonitorsBadRequest","description":"Response for status 409."}}}},"/webdbs/collections":{"post":{"x-hidden":true,"summary":"Create a collection","description":"Creates a collection and queues its first sync. Use the preview endpoint first to test extraction.","operationId":"createWebdbCollection","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebdbsCreateCollectionRequest"},"example":{"name":"Acme products","schema":{"type":"object","properties":{"title":{"type":"string","description":"Product name"},"price":{"type":"number","description":"Current price as a plain number"},"currency":{"type":"string","description":"ISO 4217 currency code"}},"required":["title"],"additionalProperties":false},"eligibility":{"semantic":{"condition":"The page is a product detail page for a single product."}},"targets":[{"type":"crawl","seeds":["https://acme.com/shop"],"follow":{"match":["https://acme.com/shop/*"]},"ingest":{"match":["https://acme.com/products/*"]}}],"sync":{"every":"1d"}}}}},"security":[{"bearerAuth":[]}],"tags":["webdbs"],"responses":{"201":{"description":"Collection created","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":{"allOf":[{"$ref":"#/components/schemas/WebdbsCollection"},{"type":"object","properties":{"key_metadata":{"$ref":"#/components/schemas/KeyMetadata","description":"API key usage for this request."}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."}}},"get":{"x-hidden":true,"summary":"List collections","description":"Returns your WebDB collections.","operationId":"listWebdbCollections","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum items to return. Defaults to 25."},"required":false,"description":"Maximum items to return. Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor from a previous response."},"required":false,"description":"Pagination cursor from a previous response.","name":"cursor","in":"query"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"A paginated list of collections","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/WebdbsListCollectionsResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."}}}},"/webdbs/collections/{collection_id}":{"get":{"x-hidden":true,"summary":"Get a collection","description":"Returns one WebDB collection.","operationId":"getWebdbCollection","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"col_123","description":"Collection ID."},"required":true,"description":"Collection ID.","name":"collection_id","in":"path"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"Collection","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":{"allOf":[{"$ref":"#/components/schemas/WebdbsCollection"},{"type":"object","properties":{"key_metadata":{"$ref":"#/components/schemas/KeyMetadata","description":"API key usage for this request."}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}},"patch":{"x-hidden":true,"summary":"Update a collection","description":"Changes collection settings. New extraction rules apply on future syncs.","operationId":"updateWebdbCollection","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebdbsUpdateCollectionRequest"},"example":{"status":"paused"}}}},"security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"col_123","description":"Collection ID."},"required":true,"description":"Collection ID.","name":"collection_id","in":"path"}],"responses":{"200":{"description":"Updated collection","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":{"allOf":[{"$ref":"#/components/schemas/WebdbsCollection"},{"type":"object","properties":{"key_metadata":{"$ref":"#/components/schemas/KeyMetadata","description":"API key usage for this request."}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}},"delete":{"x-hidden":true,"summary":"Delete a collection","description":"Deletes a collection and all data stored for it.","operationId":"deleteWebdbCollection","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"col_123","description":"Collection ID."},"required":true,"description":"Collection ID.","name":"collection_id","in":"path"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"Collection deleted","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/WebdbsDeleteResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/collections/{collection_id}/sync":{"post":{"x-hidden":true,"summary":"Trigger a sync now","description":"Queues a sync now. Returns the current run when a sync is already active.","operationId":"syncWebdbCollection","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"col_123","description":"Collection ID."},"required":true,"description":"Collection ID.","name":"collection_id","in":"path"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"202":{"description":"Sync queued","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/WebdbsRunQueuedResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/collections/{collection_id}/reprocess":{"post":{"x-hidden":true,"summary":"Reprocess rows from stored snapshots","description":"Extracts rows again from saved pages without fetching them again. Use `where` to select rows.","operationId":"reprocessWebdbCollection","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebdbsReprocessRequest"}}}},"security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"col_123","description":"Collection ID."},"required":true,"description":"Collection ID.","name":"collection_id","in":"path"}],"responses":{"202":{"description":"Reprocess queued","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/WebdbsRunQueuedResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/collections/{collection_id}/purge":{"post":{"x-hidden":true,"summary":"Purge rows by URL pattern","description":"Permanently deletes matching rows, change history, and saved pages.","operationId":"purgeWebdbCollection","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebdbsPurgeRequest"},"example":{"url_match":["https://acme.com/users/*"]}}}},"security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"col_123","description":"Collection ID."},"required":true,"description":"Collection ID.","name":"collection_id","in":"path"}],"responses":{"202":{"description":"Purge queued","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/WebdbsRunQueuedResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/collections/{collection_id}/query":{"post":{"x-hidden":true,"summary":"Query rows","description":"Filters and sorts collection rows. Use `next_cursor` to load more results.","operationId":"queryWebdbCollection","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebdbsQueryRequest"},"example":{"where":{"price":{"lt":200},"currency":"USD"},"order_by":[{"field":"price","dir":"asc"}],"limit":50}}}},"security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"col_123","description":"Collection ID."},"required":true,"description":"Collection ID.","name":"collection_id","in":"path"}],"responses":{"200":{"description":"A page of matching rows","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/WebdbsQueryResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/collections/{collection_id}/runs":{"get":{"x-hidden":true,"summary":"List runs for a collection","description":"Returns recent runs for a collection.","operationId":"listWebdbCollectionRuns","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"col_123","description":"Collection ID."},"required":true,"description":"Collection ID.","name":"collection_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum items to return. Defaults to 25."},"required":false,"description":"Maximum items to return. Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor from a previous response."},"required":false,"description":"Pagination cursor from a previous response.","name":"cursor","in":"query"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"A paginated list of runs, newest first","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/WebdbsListRunsResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/collections/{collection_id}/rejections":{"get":{"x-hidden":true,"summary":"List rejections for a collection","description":"Returns pages that did not become rows and explains why.","operationId":"listWebdbCollectionRejections","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"col_123","description":"Collection ID."},"required":true,"description":"Collection ID.","name":"collection_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum items to return. Defaults to 25."},"required":false,"description":"Maximum items to return. Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor from a previous response."},"required":false,"description":"Pagination cursor from a previous response.","name":"cursor","in":"query"},{"schema":{"type":"string","description":"Return entries at or after this time.","example":"2026-01-01T00:00:00Z"},"required":false,"description":"Return entries at or after this time.","name":"since","in":"query"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"A paginated list of rejections, newest first","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/WebdbsListRejectionsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/collections/{collection_id}/changes":{"get":{"x-hidden":true,"summary":"List changes for a collection","description":"Returns row changes for a collection, newest first.","operationId":"listWebdbCollectionChanges","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"col_123","description":"Collection ID."},"required":true,"description":"Collection ID.","name":"collection_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum items to return. Defaults to 25."},"required":false,"description":"Maximum items to return. Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor from a previous response."},"required":false,"description":"Pagination cursor from a previous response.","name":"cursor","in":"query"},{"schema":{"type":"string","description":"Return entries at or after this time.","example":"2026-01-01T00:00:00Z"},"required":false,"description":"Return entries at or after this time.","name":"since","in":"query"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"A paginated list of row changes, newest first","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/WebdbsListChangesResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/rows/{row_id}":{"get":{"x-hidden":true,"summary":"Get a row","description":"Returns one row and links to its latest saved page.","operationId":"getWebdbRow","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"row_1a2b3c","description":"Row ID."},"required":true,"description":"Row ID.","name":"row_id","in":"path"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"Row","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":{"allOf":[{"$ref":"#/components/schemas/WebdbsRow"},{"type":"object","properties":{"key_metadata":{"$ref":"#/components/schemas/KeyMetadata","description":"API key usage for this request."}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}},"delete":{"x-hidden":true,"summary":"Delete a row","description":"Deletes a row. Set `purge=true` to also delete its history and saved pages.","operationId":"deleteWebdbRow","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"row_1a2b3c","description":"Row ID."},"required":true,"description":"Row ID.","name":"row_id","in":"path"},{"schema":{"type":"boolean","default":false,"description":"Also delete row history and saved pages."},"required":false,"description":"Also delete row history and saved pages.","name":"purge","in":"query"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"Row deleted","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/WebdbsDeleteResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/rows/{row_id}/history":{"get":{"x-hidden":true,"summary":"Get a row's change history","description":"Returns changes for one row, newest first.","operationId":"getWebdbRowHistory","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"row_1a2b3c","description":"Row ID."},"required":true,"description":"Row ID.","name":"row_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum items to return. Defaults to 25."},"required":false,"description":"Maximum items to return. Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor from a previous response."},"required":false,"description":"Pagination cursor from a previous response.","name":"cursor","in":"query"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"Row change history","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/WebdbsRowHistory"}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/rows/{row_id}/snapshot":{"get":{"x-hidden":true,"summary":"Download a row's page snapshot","description":"Redirects to the latest saved page in HTML or Markdown.","operationId":"getWebdbRowSnapshot","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"row_1a2b3c","description":"Row ID."},"required":true,"description":"Row ID.","name":"row_id","in":"path"},{"schema":{"type":"string","enum":["markdown","html"],"default":"markdown","description":"Snapshot format to download."},"required":false,"description":"Snapshot format to download.","name":"format","in":"query"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"302":{"description":"Redirect to a short-lived signed URL for the snapshot document","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Location":{"description":"Short-lived signed URL serving the snapshot in the requested format.","schema":{"type":"string","format":"uri"}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/runs/{run_id}":{"get":{"x-hidden":true,"summary":"Get a run","description":"Returns the status and results of one collection run.","operationId":"getWebdbRun","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"run_123","description":"Run ID."},"required":true,"description":"Run ID.","name":"run_id","in":"path"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"Run","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":{"allOf":[{"$ref":"#/components/schemas/WebdbsRun"},{"type":"object","properties":{"key_metadata":{"$ref":"#/components/schemas/KeyMetadata","description":"API key usage for this request."}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/webhooks":{"post":{"x-hidden":true,"summary":"Create a webhook","description":"Creates a webhook for row and run events. Use the returned secret to verify signatures.","operationId":"createWebdbWebhook","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebdbsCreateWebhookRequest"},"example":{"url":"https://example.com/webhook","events":["row.created","row.updated"],"collection_id":"col_123","on":{"fields":["price"]}}}}},"security":[{"bearerAuth":[]}],"tags":["webdbs"],"responses":{"201":{"description":"Webhook created","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":{"allOf":[{"$ref":"#/components/schemas/WebdbsWebhook"},{"type":"object","properties":{"key_metadata":{"$ref":"#/components/schemas/KeyMetadata","description":"API key usage for this request."}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."}}},"get":{"x-hidden":true,"summary":"List webhooks","description":"Returns your WebDB webhooks.","operationId":"listWebdbWebhooks","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum items to return. Defaults to 25."},"required":false,"description":"Maximum items to return. Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor from a previous response."},"required":false,"description":"Pagination cursor from a previous response.","name":"cursor","in":"query"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"A paginated list of webhooks","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/WebdbsListWebhooksResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."}}}},"/webdbs/webhooks/{webhook_id}":{"get":{"x-hidden":true,"summary":"Get a webhook","description":"Returns one WebDB webhook.","operationId":"getWebdbWebhook","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"wh_123","description":"Webhook ID."},"required":true,"description":"Webhook ID.","name":"webhook_id","in":"path"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"Webhook","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":{"allOf":[{"$ref":"#/components/schemas/WebdbsWebhook"},{"type":"object","properties":{"key_metadata":{"$ref":"#/components/schemas/KeyMetadata","description":"API key usage for this request."}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}},"patch":{"x-hidden":true,"summary":"Update a webhook","description":"Changes a WebDB webhook.","operationId":"updateWebdbWebhook","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebdbsUpdateWebhookRequest"},"example":{"events":["row.updated","run.failed"]}}}},"security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"wh_123","description":"Webhook ID."},"required":true,"description":"Webhook ID.","name":"webhook_id","in":"path"}],"responses":{"200":{"description":"Updated webhook","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":{"allOf":[{"$ref":"#/components/schemas/WebdbsWebhook"},{"type":"object","properties":{"key_metadata":{"$ref":"#/components/schemas/KeyMetadata","description":"API key usage for this request."}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}},"delete":{"x-hidden":true,"summary":"Delete a webhook","description":"Deletes a WebDB webhook.","operationId":"deleteWebdbWebhook","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"wh_123","description":"Webhook ID."},"required":true,"description":"Webhook ID.","name":"webhook_id","in":"path"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"Webhook deleted","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/WebdbsDeleteResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/webhooks/{webhook_id}/deliveries":{"get":{"x-hidden":true,"summary":"List webhook deliveries","description":"Returns delivery attempts for a webhook, newest first.","operationId":"listWebdbWebhookDeliveries","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","example":"wh_123","description":"Webhook ID."},"required":true,"description":"Webhook ID.","name":"webhook_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum items to return. Defaults to 25."},"required":false,"description":"Maximum items to return. Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor from a previous response."},"required":false,"description":"Pagination cursor from a previous response.","name":"cursor","in":"query"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"A paginated list of deliveries, newest first","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/WebdbsListDeliveriesResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}}}},"/webdbs/preview":{"post":{"x-hidden":true,"summary":"Preview extraction (dry run)","description":"Tests extraction on up to 5 URLs without creating a collection. Each URL costs 1 credit.","operationId":"previewWebdb","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebdbsPreviewRequest"},"example":{"urls":["https://acme.com/products/anvil"],"schema":{"type":"object","properties":{"title":{"type":"string","description":"Product name"},"price":{"type":"number","description":"Current price as a plain number"},"currency":{"type":"string","description":"ISO 4217 currency code"}},"required":["title"],"additionalProperties":false},"eligibility":{"semantic":{"condition":"The page is a product detail page for a single product."}}}}}},"security":[{"bearerAuth":[]}],"tags":["webdbs"],"responses":{"200":{"description":"Per-URL preview results","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/WebdbsPreviewResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."}}}},"/webdbs/usage":{"get":{"x-hidden":true,"summary":"WebDBs credit usage","description":"Returns WebDB credit, row, sync, and storage usage.","operationId":"getWebdbUsage","security":[{"bearerAuth":[]}],"tags":["webdbs"],"parameters":[{"schema":{"type":"string","format":"date-time","description":"Start of the usage period."},"required":false,"description":"Start of the usage period.","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"End of the usage period."},"required":false,"description":"End of the usage period.","name":"to","in":"query"},{"$ref":"#/components/parameters/RequestTags"}],"responses":{"200":{"description":"Usage summary","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/WebdbsUsageResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."}}}},"/batch/submit":{"post":{"summary":"Submit a batch","description":"Scrape 25K URLs or crawl large websites asynchronously. ","operationId":"submitBatch","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchSubmitRequest"},"examples":{"scrapeMarkdown":{"summary":"Scrape URLs as Markdown","value":{"input":{"type":"scrape","data":{"type":"markdown","urls":[{"url":"https://example.com/products/anvil","itemId":"sku-1","meta":{"category":"tools"}},{"url":"https://example.com/products/hammer","itemId":"sku-2"}],"options":{"useMainContentOnly":true}}}}},"scrapeHtml":{"summary":"Scrape URLs as HTML","value":{"input":{"type":"scrape","data":{"type":"html","urls":[{"url":"https://example.com/about"},{"url":"https://example.com/pricing"}]}}}},"crawlStartUrlMarkdown":{"summary":"Crawl from a URL as Markdown","value":{"input":{"type":"crawl","data":{"type":"markdown","source":{"type":"start_url","url":"https://example.com/docs","controls":{"maxUrls":500,"maxDepth":3,"followSubdomains":false,"regex":"^https://example\\.com/docs/"}},"options":{"includeLinks":true}}}}},"crawlStartUrlHtml":{"summary":"Crawl from a URL as HTML","value":{"input":{"type":"crawl","data":{"type":"html","source":{"type":"start_url","url":"https://example.com/blog","controls":{"maxUrls":100}}}}}},"crawlSitemapMarkdown":{"summary":"Crawl a sitemap as Markdown","value":{"input":{"type":"crawl","data":{"type":"markdown","source":{"type":"sitemap","domain":"example.com","controls":{"maxUrls":500,"regex":"^https://example\\.com/docs/"}}}}}},"crawlSitemapHtml":{"summary":"Crawl a sitemap as HTML","value":{"input":{"type":"crawl","data":{"type":"html","source":{"type":"sitemap","domain":"example.com","controls":{"maxUrls":500,"maxDepth":0}}}}}}}}}},"security":[{"bearerAuth":[]}],"tags":["Batch"],"parameters":[{"schema":{"type":"string","maxLength":200,"description":"Any string unique to this submission. Retries with the same key return the original batch."},"required":false,"description":"Any string unique to this submission. Retries with the same key return the original batch.","name":"Idempotency-Key","in":"header"}],"responses":{"202":{"description":"Batch accepted. Read progress and results from `GET /batch/{batch_id}`.","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":{"allOf":[{"$ref":"#/components/schemas/BatchAccepted"},{"type":"object","properties":{"key_metadata":{"$ref":"#/components/schemas/KeyMetadata","description":"API key usage for this request."}}}]}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"403":{"description":"Concurrent batch limit reached (error_code BATCH_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"}}}},"409":{"description":"Idempotency-Key reused with a different body (error_code IDEMPOTENCY_KEY_CONFLICT).","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"}}}},"500":{"description":"Batch input could not be staged or queued.","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.batch.submit({\n  input: {\n    data: {\n      urls: [\n        {\n          url: 'https://example.com/products/anvil',\n          itemId: 'sku-1',\n          meta: { category: 'tools' },\n        },\n        { url: 'https://example.com/products/hammer', itemId: 'sku-2' },\n      ],\n      options: { useMainContentOnly: true },\n    },\n  },\n});\n\nconsole.log(response.id);"},{"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.batch.submit(\n    input={\n        \"data\": {\n            \"urls\": [{\n                \"url\": \"https://example.com/products/anvil\",\n                \"item_id\": \"sku-1\",\n                \"meta\": {\n                    \"category\": \"tools\"\n                },\n            }, {\n                \"url\": \"https://example.com/products/hammer\",\n                \"item_id\": \"sku-2\",\n            }],\n            \"options\": {\n                \"use_main_content_only\": True\n            },\n        }\n    },\n)\nprint(response.id)"},{"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.Batch.Submit(context.TODO(), contextdev.BatchSubmitParams{\n\t\tInput: contextdev.BatchSubmitParamsInputUnion{\n\t\t\tOfScrape: &contextdev.BatchSubmitParamsInputScrape{\n\t\t\t\tData: contextdev.BatchSubmitParamsInputScrapeDataUnion{\n\t\t\t\t\tOfMarkdown: &contextdev.BatchSubmitParamsInputScrapeDataMarkdown{\n\t\t\t\t\t\tURLs: []contextdev.BatchSubmitParamsInputScrapeDataMarkdownURL{{\n\t\t\t\t\t\t\tURL:    \"https://example.com/products/anvil\",\n\t\t\t\t\t\t\tItemID: contextdev.String(\"sku-1\"),\n\t\t\t\t\t\t\tMeta: map[string]any{\n\t\t\t\t\t\t\t\t\"category\": \"tools\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tURL:    \"https://example.com/products/hammer\",\n\t\t\t\t\t\t\tItemID: contextdev.String(\"sku-2\"),\n\t\t\t\t\t\t}},\n\t\t\t\t\t\tOptions: contextdev.BatchSubmitParamsInputScrapeDataMarkdownOptions{\n\t\t\t\t\t\t\tUseMainContentOnly: contextdev.Bool(true),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.ID)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.batch.submit(\n  input: {\n    data: {\n      format: :markdown,\n      urls: [{url: \"https://example.com/products/anvil\"}, {url: \"https://example.com/products/hammer\"}]\n    },\n    mode: :scrape\n  }\n)\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->batch->submit(\n    input: [\n      'data' => [\n        'format' => 'markdown',\n        'urls' => [\n          [\n            'url' => 'https://example.com/products/anvil',\n            'itemID' => 'sku-1',\n            'meta' => ['category' => 'bar'],\n          ],\n          [\n            'url' => 'https://example.com/products/hammer',\n            'itemID' => 'sku-2',\n            'meta' => ['foo' => 'bar'],\n          ],\n        ],\n        'options' => [\n          'country' => 'de',\n          'excludeSelectors' => ['x'],\n          'includeHTML' => true,\n          'includeImages' => true,\n          'includeLinks' => true,\n          'includeSelectors' => ['x'],\n          'maxAgeMs' => 0,\n          'pdf' => [\n            'end' => 1, 'ocr' => true, 'shouldParse' => true, 'start' => 1\n          ],\n          'settleAnimations' => true,\n          'shortenBase64Images' => true,\n          'useMainContentOnly' => true,\n          'waitForMs' => 0,\n        ],\n      ],\n      'mode' => 'scrape',\n    ],\n    tags: ['docs', 'competitor'],\n    webhookURL: 'webhookUrl',\n    idempotencyKey: 'Idempotency-Key',\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev batch submit \\\n  --api-key 'My API Key' \\\n  --input '{data: {format: markdown, urls: [{url: https://example.com/products/anvil}, {url: https://example.com/products/hammer}]}, mode: scrape}'"}]}},"/batch/list":{"get":{"summary":"List batches","description":"List your batches from newest to oldest. Filter by status or continue with a cursor.","operationId":"listBatches","security":[{"bearerAuth":[]}],"tags":["Batch"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Batches per page. Defaults to 25."},"required":false,"description":"Batches per page. Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Cursor from the previous page."},"required":false,"description":"Cursor from the previous page.","name":"cursor","in":"query"},{"schema":{"type":"string","enum":["queued","running","cancelling","completed","cancelled","failed"],"description":"Filter by status."},"required":false,"description":"Filter by status.","name":"status","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Free-text search term, matched against the batch id, crawl source (start URL or sitemap domain), and tags.","example":"batch_1a2b"},"required":false,"description":"Free-text search term, matched against the batch id, crawl source (start URL or sitemap domain), and tags.","name":"q","in":"query"},{"schema":{"type":"string","enum":["exact","prefix"],"description":"`prefix` for as-you-type prefix matching (default), `exact` for full-token matching."},"required":false,"description":"`prefix` for as-you-type prefix matching (default), `exact` for full-token matching.","name":"search_type","in":"query"},{"schema":{"type":"string","description":"Comma-separated list of tags to filter by (matches batches having any of them).","example":"docs,competitor"},"required":false,"description":"Comma-separated list of tags to filter by (matches batches having any of them).","name":"tags","in":"query"}],"responses":{"200":{"description":"Your batches, newest first. Use `next_cursor` to page through the rest.","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":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Batch"},"description":"Batches on this page."},"has_more":{"type":"boolean","description":"Whether another page is available."},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for the next page."},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."}},"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 batches = await client.batch.list();\n\nconsole.log(batches.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)\nbatches = client.batch.list()\nprint(batches.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\tbatches, err := client.Batch.List(context.TODO(), contextdev.BatchListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", batches.Data)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nbatches = context_dev.batch.list\n\nputs(batches)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $batches = $client->batch->list(\n    cursor: 'cursor',\n    limit: 1,\n    q: 'batch_1a2b',\n    searchType: 'exact',\n    status: 'queued',\n    tags: 'docs,competitor',\n  );\n\n  var_dump($batches);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev batch list \\\n  --api-key 'My API Key'"}]}},"/batch/{batch_id}":{"get":{"summary":"Get a batch","description":"Check progress, and get download links once the batch finishes.","operationId":"getBatch","security":[{"bearerAuth":[]}],"tags":["Batch"],"parameters":[{"schema":{"type":"string","example":"batch_9f2c8a","description":"ID of the batch to retrieve or cancel."},"required":true,"description":"ID of the batch to retrieve or cancel.","name":"batch_id","in":"path"}],"responses":{"200":{"description":"Current state of the batch, with download links once it has finished.","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":{"allOf":[{"$ref":"#/components/schemas/Batch"},{"type":"object","properties":{"key_metadata":{"$ref":"#/components/schemas/KeyMetadata","description":"API key usage for this request."}}},{"$ref":"#/components/schemas/BatchDetail"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."}},"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 batch = await client.batch.retrieve('batch_9f2c8a');\n\nconsole.log(batch.id);"},{"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)\nbatch = client.batch.retrieve(\n    \"batch_9f2c8a\",\n)\nprint(batch.id)"},{"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\tbatch, err := client.Batch.Get(context.TODO(), \"batch_9f2c8a\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", batch.ID)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nbatch = context_dev.batch.retrieve(\"batch_9f2c8a\")\n\nputs(batch)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $batch = $client->batch->retrieve('batch_9f2c8a');\n\n  var_dump($batch);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev batch retrieve \\\n  --api-key 'My API Key' \\\n  --batch-id batch_9f2c8a"}]},"delete":{"summary":"Delete a batch","description":"Permanently delete a finished batch and its stored results. Active batches must settle first.","operationId":"deleteBatch","security":[{"bearerAuth":[]}],"tags":["Batch"],"parameters":[{"schema":{"type":"string","example":"batch_9f2c8a","description":"ID of the batch to retrieve or cancel."},"required":true,"description":"ID of the batch to retrieve or cancel.","name":"batch_id","in":"path"}],"responses":{"200":{"description":"Batch and its stored results are permanently deleted.","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":{"id":{"type":"string","description":"ID of the deleted batch."},"deleted":{"type":"boolean","description":"Always true on success."},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."},"409":{"description":"Batch is still active. Cancel it and let it settle before deleting.","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 batch = await client.batch.delete('batch_9f2c8a');\n\nconsole.log(batch.id);"},{"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)\nbatch = client.batch.delete(\n    \"batch_9f2c8a\",\n)\nprint(batch.id)"},{"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\tbatch, err := client.Batch.Delete(context.TODO(), \"batch_9f2c8a\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", batch.ID)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nbatch = context_dev.batch.delete(\"batch_9f2c8a\")\n\nputs(batch)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $batch = $client->batch->delete('batch_9f2c8a');\n\n  var_dump($batch);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev batch delete \\\n  --api-key 'My API Key' \\\n  --batch-id batch_9f2c8a"}]}},"/batch/{batch_id}/results":{"get":{"summary":"Get batch results","description":"Page through a finished batch's results as JSON instead of downloading the NDJSON files.","operationId":"getBatchResults","security":[{"bearerAuth":[]}],"tags":["Batch"],"parameters":[{"schema":{"type":"string","example":"batch_9f2c8a","description":"ID of the batch to retrieve or cancel."},"required":true,"description":"ID of the batch to retrieve or cancel.","name":"batch_id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Records per page. Defaults to 25. A page can close early so its payload stays under ~8 MB; rely on next_cursor rather than counting records."},"required":false,"description":"Records per page. Defaults to 25. A page can close early so its payload stays under ~8 MB; rely on next_cursor rather than counting records.","name":"limit","in":"query"},{"schema":{"type":"string","description":"next_cursor from the previous page."},"required":false,"description":"next_cursor from the previous page.","name":"cursor","in":"query"}],"responses":{"200":{"description":"One page of result records. Keep paging with `next_cursor` while `has_more` is true.","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":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BatchResultRecord"},"description":"Result records on this page."},"has_more":{"type":"boolean","description":"Whether another page is available."},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for the next page."},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}}}}}},"400":{"$ref":"#/components/responses/BadRequest","description":"Response for status 400."},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."},"409":{"description":"Batch has not finished yet (error_code BATCH_NOT_COMPLETED).","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.batch.getResults('batch_9f2c8a');\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.batch.get_results(\n    batch_id=\"batch_9f2c8a\",\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.Batch.GetResults(\n\t\tcontext.TODO(),\n\t\t\"batch_9f2c8a\",\n\t\tcontextdev.BatchGetResultsParams{},\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.batch.get_results(\"batch_9f2c8a\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->batch->getResults(\n    'batch_9f2c8a', cursor: 'cursor', limit: 1\n  );\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev batch get-results \\\n  --api-key 'My API Key' \\\n  --batch-id batch_9f2c8a"}]}},"/batch/{batch_id}/cancel":{"post":{"summary":"Cancel a batch","description":"Stop a batch from starting new pages. In-progress pages finish, and unused credits are refunded.","operationId":"cancelBatch","security":[{"bearerAuth":[]}],"tags":["Batch"],"parameters":[{"schema":{"type":"string","example":"batch_9f2c8a","description":"ID of the batch to retrieve or cancel."},"required":true,"description":"ID of the batch to retrieve or cancel.","name":"batch_id","in":"path"}],"responses":{"202":{"description":"Cancellation started. Poll `GET /batch/{batch_id}` until the batch settles.","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":{"allOf":[{"$ref":"#/components/schemas/BatchCancelling"},{"type":"object","properties":{"key_metadata":{"$ref":"#/components/schemas/KeyMetadata","description":"API key usage for this request."}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized","description":"Response for status 401."},"404":{"$ref":"#/components/responses/NotFound","description":"Response for status 404."},"409":{"description":"Batch already reached a terminal state, so there is nothing to cancel.","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.batch.cancel('batch_9f2c8a');\n\nconsole.log(response.id);"},{"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.batch.cancel(\n    \"batch_9f2c8a\",\n)\nprint(response.id)"},{"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.Batch.Cancel(context.TODO(), \"batch_9f2c8a\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.ID)\n}\n"},{"lang":"Ruby","source":"require \"context_dev\"\n\ncontext_dev = ContextDev::Client.new(api_key: \"My API Key\")\n\nresponse = context_dev.batch.cancel(\"batch_9f2c8a\")\n\nputs(response)"},{"lang":"PHP","source":"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\nuse ContextDev\\Client;\nuse ContextDev\\Core\\Exceptions\\APIException;\n\n$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');\n\ntry {\n  $response = $client->batch->cancel('batch_9f2c8a');\n\n  var_dump($response);\n} catch (APIException $e) {\n  echo $e->getMessage();\n}"},{"lang":"CLI","source":"context-dev batch cancel \\\n  --api-key 'My API Key' \\\n  --batch-id batch_9f2c8a"}]}},"/company/funding":{"post":{"summary":"Retrieve company funding","description":"Retrieve the structured funding history (rounds, dates, amounts) for a company by its domain. Served from Context's continuously updated company graph, which aggregates funding rounds observed across company data sources and global business news. Domains with no known funding data return an empty rounds list and are not charged.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","description":"The domain name of the company to retrieve funding history for."},"timeoutMS":{"$ref":"#/components/schemas/TimeoutMS"},"tags":{"$ref":"#/components/schemas/RequestTags"}}}}}},"security":[{"bearerAuth":[]}],"tags":["Company"],"x-mint":{"content":"<Badge color=\"orange\">25 Credits</Badge>","title":"Retrieve company funding","sidebarTitle":"Retrieve company funding","description":"Retrieve the structured funding history (rounds, dates, amounts) for a company by its domain."},"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 analyzed"},"rounds":{"type":"array","items":{"type":"object","properties":{"round":{"type":"object","properties":{"identifier":{"type":"string","enum":["pre_seed","seed","angel","series_a","series_b","series_c","series_d","series_e","series_f","series_g","series_h","series_i","series_j","series_k","series_l","series_m","extension","debt_financing","growth_debt","strategic_investment","safe_convertible","corporate_round","private_equity","grant","equity_crowdfunding","product_crowdfunding","secondary_market","ipo","post_ipo_equity","post_ipo_debt","post_ipo_secondary","initial_coin_offering","non_equity_assistance","earlier_rounds","unlabeled"],"description":"Canonical round identifier. `unlabeled` is the catch-all for rounds that do not match any standard stage."},"label":{"type":"string","description":"Human-readable round label (e.g. 'Series A')."}},"required":["identifier","label"],"description":"Canonical identifier and human-readable label for the round."},"announced_on":{"type":"string","format":"date","description":"Date the round was announced or first reported, as YYYY-MM-DD."},"amount_raised":{"type":["object","null"],"properties":{"value":{"type":"integer","description":"Amount raised in whole units of `currency` (e.g. a $150M round is returned as 150000000)."},"label":{"type":"string","description":"Human-readable compact amount (e.g. '$150M')."},"currency":{"type":["string","null"],"description":"ISO 4217 code of the currency the amount is denominated in (e.g. 'USD'). Null when the source did not record one."}},"required":["value","label","currency"],"description":"Total amount raised in this round, or null when the round is known but its amount was not disclosed."}},"required":["round","announced_on","amount_raised"]},"description":"Distinct funding rounds known for this company, in chronological order. Repeated reports of the same round are consolidated; rounds with an undisclosed amount are included with a null amount_raised."},"key_metadata":{"$ref":"#/components/schemas/KeyMetadata"}},"required":["status","domain","rounds"]}}}},"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","description":"Response for status 429."},"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"}}}}}}},"operationId":"post_company_funding"}}},"webhooks":{"monitorChangeDetected":{"post":{"summary":"Monitor change detected","description":"Sent to a monitor's configured webhook URL when a run detects a change. Return any 2xx response to acknowledge the delivery.","operationId":"monitorChangeDetected","tags":["Monitors"],"security":[],"parameters":[{"name":"User-Agent","in":"header","required":true,"description":"Identifies the Context.dev webhook sender.","schema":{"type":"string","example":"Context.dev-Webhooks/1.0"}},{"name":"X-Context-Event","in":"header","required":true,"description":"Event type for this delivery.","schema":{"type":"string","enum":["change.detected"]}},{"name":"X-Context-Id","in":"header","required":true,"description":"Unique event ID. Matches the top-level `id` field in the request body.","schema":{"type":"string","example":"evt_123"}},{"name":"X-Context-Signature","in":"header","description":"HMAC signature in the form `t=<unix>,v1=<hmac>`. The HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"`, keyed with the monitor webhook secret. Verify the unmodified request body with a constant-time comparison and reject stale timestamps.","schema":{"type":"string","example":"t=1783620012,v1=087d98aada1e39f9d24d65951f51e672da12b2f9ea1c02c7c8c5ef254f5d4068"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorsChangeDetectedWebhookPayload"}}}},"responses":{"2XX":{"description":"Webhook accepted."}}}},"monitorRunCompleted":{"post":{"summary":"Monitor run completed","description":"Sent to a monitor's configured webhook URL after every completed run when the webhook subscribes to the run.completed event — including runs that detected no change, as confirmation the monitor ran. When a change was detected it is embedded in the payload. Return any 2xx response to acknowledge the delivery.","operationId":"monitorRunCompleted","tags":["Monitors"],"security":[],"parameters":[{"name":"User-Agent","in":"header","required":true,"description":"Identifies the Context.dev webhook sender.","schema":{"type":"string","example":"Context.dev-Webhooks/1.0"}},{"name":"X-Context-Event","in":"header","required":true,"description":"Event type for this delivery.","schema":{"type":"string","enum":["run.completed"]}},{"name":"X-Context-Id","in":"header","required":true,"description":"Unique event ID. Matches the top-level `id` field in the request body.","schema":{"type":"string","example":"evt_123"}},{"name":"X-Context-Signature","in":"header","description":"HMAC signature in the form `t=<unix>,v1=<hmac>`. The HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"`, keyed with the monitor webhook secret. Verify the unmodified request body with a constant-time comparison and reject stale timestamps.","schema":{"type":"string","example":"t=1783620012,v1=087d98aada1e39f9d24d65951f51e672da12b2f9ea1c02c7c8c5ef254f5d4068"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorsRunCompletedWebhookPayload"}}}},"responses":{"2XX":{"description":"Webhook accepted."}}}},"batchSettled":{"post":{"summary":"Batch settled","description":"Sent to a batch's `webhookUrl` once it reaches a final status, whether it completed, was cancelled, or failed. Delivery is best effort and at most once: one attempt, a 10 second timeout, no retries, and any response status is treated as acknowledged. Polling GET /batch/{batch_id} remains the authoritative completion signal. The embedded batch carries signed result URLs that expire, so download them promptly or re-read the batch.","operationId":"batchSettled","tags":["Batches"],"security":[],"parameters":[{"name":"User-Agent","in":"header","required":true,"description":"Identifies the Context.dev webhook sender.","schema":{"type":"string","example":"Context.dev-Webhooks/1.0"}},{"name":"X-Context-Event","in":"header","required":true,"description":"Which final status the batch reached. Matches the `event` field in the request body.","schema":{"type":"string","enum":["batch.completed","batch.cancelled","batch.failed"]}},{"name":"X-Context-Id","in":"header","required":true,"description":"Unique event ID. Matches the top-level `id` field in the request body.","schema":{"type":"string","example":"evt_123"}},{"name":"X-Context-Signature","in":"header","description":"HMAC signature in the form `t=<unix>,v1=<hmac>`. The HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"`, keyed with the `webhook_secret` from the submit response. Sent only when the batch was submitted with a `webhookUrl`. Verify the unmodified request body with a constant-time comparison and reject stale timestamps.","schema":{"type":"string","example":"t=1783620012,v1=087d98aada1e39f9d24d65951f51e672da12b2f9ea1c02c7c8c5ef254f5d4068"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchSettledWebhookPayload"}}}},"responses":{"2XX":{"description":"Webhook accepted."}}}}}}