API Reference
Glance enriches public URLs and returns an AI-improved title, description, content type, a Glance-generated OG preview image, and optional safety and injection metadata.
Two enrichment modes: /v1/enrich (Basic — fast fixed pipeline, all plans) and /v1/intelligence (agent with trust scoring and audit trail, Growth+). Both reject private-network and metadata URLs before any fetch.
Try the live playground without an API key, or sign in to get a key and use the authenticated endpoints.
Base URLs
Use the same paths on either host. This site also rewrites /v1/* to /api/v1/* so both work on useglance.io.
Website + app-hosted API
https://www.useglance.io/api/v1Shorthand: https://www.useglance.io/v1 (same routes). /v1/intelligence is available on this host only.
Production API (Cloudflare Worker)
https://api.useglance.io/v1Persistent keys, batch jobs, and OG images on cdn.useglance.io when the worker is deployed. Basic enrich and safety only — no /v1/intelligence on this host yet.
Authentication
Authenticated endpoints require a Bearer token. The playground is the only public enrich path.
Authorization: Bearer glance_your_api_key_here
Sign in at /login with your email and API key. Keys are shown and copied from the dashboard. Key rotation is not available in the dashboard yet.
Playground
Try enrichment without auth. Does not count toward monthly quota. Same URL rules as enrich — only public http and https URLs; private IPs and localhost are rejected.
/v1/playgroundParameters
| Param | Type | Description |
|---|---|---|
url | string | Required. URL-encoded public http(s) URL. Private networks and metadata endpoints are blocked. |
Example
curl "https://useglance.io/v1/playground?url=https%3A%2F%2Fgithub.com%2Fvercel%2Fnext.js"
Enrich a URL
GET/v1/enrichScrapes the page, classifies content, improves title and description with a cloud LLM, and renders a 1200×630 PNG card using your template settings. Always returns a Glance-generated og_image (not the site's original OG file). Private IPs, localhost, and cloud metadata URLs are rejected before any fetch. Page fetches run in an isolated Browserless sandbox in production. Basic pipeline: scrape → classify → OG card. Also scans page text for prompt-injection patterns on every request (injection_risk). Counts toward monthly quota on all plans.
Parameters
| Param | Type | Description |
|---|---|---|
url | string | Required. URL-encoded public http(s) URL. Private IPs, localhost, and cloud metadata URLs return 400. |
safety | boolean | Optional. Pass "true" to include safety fields on the enrich response. |
Example
curl "https://useglance.io/v1/enrich?url=https%3A%2F%2Fgithub.com%2Fvercel%2Fnext.js&safety=true" \ -H "Authorization: Bearer glance_..."
URL Intelligence (Growth+)
Agent-powered enrichment for AI apps and security-sensitive workflows. Instead of a fixed pipeline, Glance runs a reasoning agent that gathers signals — Google Safe Browsing, VirusTotal, prompt-injection scan, domain age, archive fallback for paywalls — then classifies content and returns an auditable intelligence block with trust score and step-by-step trace.
Use when you need to safely preview links from user input, RAG citations, or agent tool calls. Basic /v1/enrich remains available on all plans for fast metadata. Requires Growth or Pro — Free and Starter receive 403 plan_required.
Host: https://www.useglance.io/v1/intelligence (app deployment only).
/v1/intelligenceParameters
| Param | Type | Description |
|---|---|---|
url | string | Required. URL-encoded public http(s) URL. Same SSRF rules as enrich. |
Example
curl "https://www.useglance.io/v1/intelligence?url=https%3A%2F%2Fexample.com" \ -H "Authorization: Bearer glance_..."
Errors
If the agent flags a URL as dangerous, the response is 403 unsafe_url with an optional intelligence.steps array showing how far the agent got before blocking.
Response (excerpt)
{
"url": "https://example.com",
"title": "...",
"confidence": 0.82,
"mode": "intelligence",
"intelligence": {
"trust_score": 0.78,
"injection_risk": "none",
"domain_age_days": 9125,
"confidence_reasoning": "High confidence — safety, domain, and content signals align.",
"used_cached_content": false,
"slug_matches_content": true,
"steps": [
{ "tool": "fetch_page", "status": "ok", "summary": "Fetched live page", "duration_ms": 420 },
{ "tool": "check_safety", "status": "ok", "summary": "Risk: safe (0.02)", "duration_ms": 180 },
{ "tool": "scan_injection", "status": "ok", "summary": "No injection patterns detected", "duration_ms": 2 }
]
}
}Safety check
Standalone risk assessment via Google Safe Browsing, VirusTotal (70+ engines), and heuristics. Counts as one enrichment toward your quota. Only public http(s) URLs accepted.
Uses VirusTotal url-info (GET cached report — fast, 1 lookup). Optional scan-url fallback when VIRUSTOTAL_SCAN_ON_MISS=true (submits unknown URLs, uses extra quota). Cached 6h, max 4 live calls/min on free tier.
/v1/safetyExample
curl "https://useglance.io/v1/safety?url=https%3A%2F%2Fexample.com" \ -H "Authorization: Bearer glance_..."
Response
{
"url": "https://example.com",
"risk_level": "safe",
"risk_score": 0.02,
"threat_types": [],
"signals": [
{ "check": "google_safe_browsing", "result": "clean", "weight": "critical", "passed": true },
{ "check": "virustotal", "result": "clean (68/72 harmless)", "weight": "critical", "passed": true }
],
"cached": false,
"processing_time_ms": 210
}risk_level values
safe | Score below 0.2, no critical threats. |
suspicious | Heuristic flags; score 0.2–0.5. |
dangerous | Safe Browsing match or score above 0.5. |
Check usage
GET/v1/usagecurl "https://useglance.io/v1/usage" \ -H "Authorization: Bearer glance_..."
Response
{
"user_id": "user_abc",
"plan": "free",
"period": "2026-05",
"count": 42,
"limit": 500,
"remaining": 458
}OG templates
Configure which card layout is used per content_type and (on Growth / Pro) brand colors, logo, fonts, and layout. Saved per API key. Edit in the dashboard or via API.
Built-in templates: article, product, repo, profile, generic. If you do not set a default for a content type, Glance picks one automatically (e.g. repo for GitHub URLs).
Get config
GET/v1/templatesUpdate config
PATCH/v1/templatesSend a partial JSON body with defaults, theme, and/or layout. Brand fields require Growth or Pro. Glance logo on OG images is always on except Pro (showBadge: false).
curl -X PATCH "https://useglance.io/v1/templates" \
-H "Authorization: Bearer glance_..." \
-H "Content-Type: application/json" \
-d '{
"defaults": { "article": "article", "repo": "repo" },
"theme": { "accentColor": "#6366f1", "showBadge": true, "fontFamily": "inter" },
"layout": { "backgroundStyle": "dark", "titleAlign": "left" }
}'Preview
POST/v1/templates/previewReturns a PNG (not JSON). Same auth as other routes.
Enrich response
{
"url": "https://github.com/vercel/next.js",
"title": "Next.js: The React Framework",
"description": "Production-ready React framework with SSR and routing.",
"og_image": "https://www.useglance.io/api/v1/img/5973e384f5c0baa1",
"share_url": "https://www.useglance.io/link?url=https%3A%2F%2Fgithub.com%2Fvercel%2Fnext.js",
"favicon": "https://github.com/favicon.ico",
"site_name": "GitHub",
"content_type": "repo",
"source": "hybrid",
"confidence": 0.95,
"injection_risk": "none",
"safety": {
"risk_level": "safe",
"risk_score": 0.02,
"threat_types": []
},
"cached": false,
"cached_at": null,
"processing_time_ms": 1240
}og_image on the worker deployment uses https://cdn.useglance.io/og/.... share_url is set when the request includes a public site origin (typical on useglance.io). safety is present when safety=true is passed on enrich.
injection_risk
Included on every enrich and intelligence response. Scans page text for prompt-injection patterns before the LLM runs.
none | No suspicious patterns detected. |
low | Minor patterns (e.g. role-override phrasing); confidence may be reduced. |
high | Strong injection signals; see optional injection.patterns on enrich. |
When risk is not none, enrich may also include:
"injection": {
"detected": true,
"risk": "high",
"patterns": ["ignore-instructions", "zero-width-chars"]
}Intelligence-only fields
/v1/intelligence responses add mode: "intelligence" and an intelligence object with trust_score, confidence_reasoning, domain_age_days, used_cached_content, slug_matches_content, and steps[] (full agent audit trail). See the Intelligence section for an example.
content_type
articleproductrepoprofilelandingvideoothersource
generated | Title and/or description mainly from AI and page content. |
existing | Strong existing OG/meta tags; little or no AI rewrite. |
hybrid | OG tags present but improved or merged with AI output. |
Caching
Results are cached by normalized URL and your template config. Cache hits return cached: true and are much faster.
On this deployment, typical TTLs are shorter (about 6–24 hours depending on content type). The worker deployment uses longer TTLs (up to 30 days for repos and profiles).
Changing template or brand settings bumps the config version so new enrichments get fresh images.
Errors
JSON error bodies include error and message.
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_url | Missing url, malformed URL, or blocked target (private IP, localhost, metadata endpoint, non-http(s)). |
| 401 | unauthorized | Missing Bearer token. |
| 403 | invalid_key | API key invalid or revoked. |
| 403 | plan_required | Endpoint requires Growth or Pro (e.g. /v1/intelligence on Free/Starter). |
| 403 | unsafe_url | URL flagged dangerous by safety checks. Intelligence may include steps[] in the body. |
| 429 | rate_limited | Monthly quota exceeded. |
| 500 | internal_error | Unexpected failure; retry. |
If scraping fails, enrich still returns a minimal result (domain + favicon) when possible rather than an empty 500.
Rate limits
Quotas are per API key per calendar month. There is no per-second rate limit on current plans.
- Each
GET /v1/enrich,GET /v1/intelligence, andGET /v1/safetycounts as one enrichment toward your quota, including cache hits. GET /v1/playgrounddoes not count.- Template GET/PATCH and preview POST do not count toward enrich quota.
See pricing for plan limits.