API Reference Documentation
Welcome to the complete developer documentation. Integrate vision-powered dynamic scraping and automated phishing forensics into your apps in minutes.
Authentication
All API requests to production endpoints require authentication using a custom header. Create your keys in the developer dashboard.
| Header | Type | Description |
|---|---|---|
| X-API-Key | string | Your active production API Key. Starts with the prefix op_live_. |
# Authenticating with cURL curl -H "X-API-Key: op_live_your_actual_key_here" \\ https://opticparse-api.onrender.com/health
Error Codes
Our APIs return standardized HTTP status codes for errors, with JSON detail bodies explaining the root cause.
| Code | Status | Description / Cause |
|---|---|---|
| 400 | Bad Request | Invalid parameters, payload too large, or malformed queries. |
| 401 | Unauthorized | Invalid or missing API key. Key format must check out. |
| 429 | Rate Limit Exceeded | Monthly request usage quota exceeded, or too many concurrent requests. |
| 500 | Internal Server Error | AI reasoning error, Playwright navigation failure, or server-side issue. |
POST /api/vision-scrape
Analyze a web page visually using headful browser rendering and return structured data according to your query and JSON schema.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| target_url | string | required | The full HTTP/HTTPS URL of the target webpage to scrape. Resolves only public URLs. |
| extraction_query | string | required | Instructions in plain English describing what data fields you want to extract. |
| response_schema | object | optional | A raw JSON schema dict defining exactly how the returned JSON object must be shaped. |
| wait_until | string | optional | Browser wait condition. Allowed: load (default), domcontentloaded, networkidle. |
| timeout | integer | optional | Browser navigation timeout in ms. Default 30,000 (30 seconds). Max 60,000. |
# Example Request curl -X POST \\ https://opticparse-api.onrender.com/api/vision-scrape \\ -H "X-API-Key: YOUR_API_KEY" \\ -H "Content-Type: application/json" \\ -d '{ "target_url": "https://news.ycombinator.com", "extraction_query": "Extract the top story title and point score" }'
POST /api/crawl
Crawl multiple pages of a website by following a CSS selector (e.g. "Next" pagination buttons) and extract structured data incrementally.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| start_url | string | required | The starting URL of the crawl. |
| extraction_query | string | required | The prompt detailing what structured data to collect from each page. |
| follow_selector | string | required | CSS selector for the pagination button to click to advance to the next page. |
| max_pages | integer | optional | Maximum number of pages to crawl. Default 5. Max 20. |
POST /api/watch
Establish a periodic monitoring task for a webpage. Compares visual states over time and fires a webhook when structural differences are detected.
POST /api/batch
Scrape up to 20 target URLs concurrently. Distributes tasks across browser runners to bypass standard sequential latencies.
POST /api/phish-detect
Visit a target URL, render the visual state, analyze it via our multimodal brand impersonation rules, and output threat forensics.
Parameters
| Field | Type | Description |
|---|---|---|
url | string | The target webpage to analyze. Must start with https:// or https://. |
dry_run | boolean (optional) | If true, bypasses AI analysis and instantly returns the raw base64 screenshot and text payload. Useful for tuning thresholds without consuming AI tokens. Default is false. |
# Example Request curl -X POST \\ https://opticparse-1opticparse-node-sg.onrender.com/api/phish-detect \\ -H "X-API-Key: YOUR_API_KEY" \\ -H "Content-Type: application/json" \\ -d '{ "url": "https://example.com", "dry_run": false }'
# Example Response { "verdict": "malicious", "confidence_score_percentage": 98, "impersonated_brand": "Microsoft", "threat_type": "brand_impersonation", "visual_anomalies_detected": ["Mismatched logo aspect ratio"], "hidden_payload_detected": null, "javascript_threats": [], "redirect_risk": "High (3 hops through bit.ly)", "domain_age_days": 2, "registrar": "Namecheap", "cached": false }
POST /api/phish-batch
Scan a list of URLs concurrently for visual threat analysis.
GET /api/phish-report
Download a detailed, brand-impersonation investigation PDF report for a previously scanned URL.
POST /api/monitor
Create a scheduled checker that periodically visits a target URL to check for malicious payloads, domain redirection anomalies, or visual phishing signs.
POST /api/stealth-browse
Bypasses sophisticated anti-bot shields (Cloudflare Turnstile, DataDome, PerimeterX) using randomized bezier human cursor curves, micro-scroll deceleration, and optional custom residential proxy routing.
Parameters
| Field | Type | Description |
|---|---|---|
url | string Required | Target protected URL to render. |
proxy | string Optional | Custom enterprise residential/datacenter proxy URL (e.g. http://user:pass@proxy.ip:port). |
wait_for_challenge_seconds | integer Optional | Seconds to allow challenge solver to settle (1–15s, default: 3). |
simulate_human_interactions | boolean Optional | Whether to inject human cursor movements and scroll jitter (default: true). |
# Stealth Browse with Custom Residential Proxy curl -X POST https://opticparse-api.onrender.com/api/stealth-browse \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/protected-page", "proxy": "http://user:pass@proxy.brightdata.com:22225", "wait_for_challenge_seconds": 3, "simulate_human_interactions": true }'
POST /api/cache/markdown
Extracts token-optimized clean Markdown stripped of 98% of HTML boilerplate (navbars, tracking pixels, ads, footers) backed by a persistent semantic edge cache with cryptographic attestation.
Parameters
| Field | Type | Description |
|---|---|---|
url | string Required | Webpage URL to convert into LLM RAG-ready markdown. |
include_links | boolean Optional | Preserve meaningful hypertext links (default: true). |
include_images | boolean Optional | Preserve image markdown alt-tags (default: false). |
POST /api/verify-attestation
Validates an HMAC-SHA256 cryptographic attestation proof proving that scraped web content was extracted accurately at a specific Unix timestamp without tampering.
Parameters
| Field | Type | Description |
|---|---|---|
url | string Required | Target URL verified. |
content_sha256 | string Required | SHA-256 hash of the extracted payload. |
timestamp | integer Required | Unix epoch timestamp issued by the oracle. |
signature | string Required | Cryptographic signature prefixed with 0x. |
Python SDK (opticparse-py v1.0.1)
The official zero-dependency Python SDK with sub-50ms local heuristic evaluation and native proxy passthrough.
# Install pip install --upgrade opticparse-py # Usage with custom proxy & fast heuristics from opticparse import OpticParse client = OpticParse( api_key="op_live_...", proxy="http://user:pass@proxy.ip:port" # Optional enterprise proxy ) # Sub-50ms rapid threat scan verdict = client.detect_phishing("https://example.com", fast_heuristics=True) print("Safety Score:", verdict["threat_score"], "Verdict:", verdict["verdict"])
LangChain Tool (langchain-opticparse v1.0.3)
Drop-in multi-agent toolkits for LangChain, CrewAI, and AutoGPT with in-terminal prepaid credit refills.
# Install pip install --upgrade langchain-opticparse # Usage with LangChain Agent from langchain_opticparse import OpticParseTool, PhishVisionTool scraper = OpticParseTool(proxy="http://proxy:8080") threat_scanner = PhishVisionTool() # Bind to any tool-calling LLM llm_with_tools = llm.bind_tools([scraper, threat_scanner])
LlamaIndex ToolSpec (llama-index-tools-opticparse)
Official BaseToolSpec integration for LlamaIndex query engines and autonomous agents.
# Install pip install llama-index-tools-opticparse # Usage in LlamaIndex from llama_index.tools.opticparse import OpticParseToolSpec from llama_index.core.agent import FunctionCallingAgentWorker tool_spec = OpticParseToolSpec(api_key="op_live_...") tools = tool_spec.to_tool_list() agent = FunctionCallingAgentWorker.from_tools(tools, llm=llm).as_agent()