API Reference

The Glance API enriches any public URL, returning an AI-improved title, description, content type, and a generated preview image.

Base URLhttps://api.useglance.io

Authentication

All API requests require a Bearer token in the Authorization header.

Authorization: Bearer glance_your_api_key_here

Get your API key from the dashboard.

Enrich a URL

GET/v1/enrich

Parameters

ParamTypeDescription
urlstringRequired. The URL to enrich. Must be URL-encoded.
safetybooleanOptional. Pass "true" to include a safety score in the response.

Example

curl "https://api.useglance.io/v1/enrich?url=https%3A%2F%2Fgithub.com%2Fvercel%2Fnext.js" \
  -H "Authorization: Bearer glance_..."

Safety check

Returns a risk assessment for any URL, powered by Google Safe Browsing plus heuristic analysis. Use it standalone or pass ?safety=true to the enrich endpoint to get both in one call.

GET/v1/safety

Example

curl "https://api.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": "hostname_type",        "result": "domain",     "weight": "high",     "passed": true },
    { "check": "phishing_patterns",    "result": "clean",      "weight": "high",     "passed": true }
  ],
  "cached": false, "processing_time_ms": 210
}

risk_level values

safeNo threats detected. Risk score below 0.2.
suspiciousHeuristic signals raised. Proceed with caution. Score 0.2 to 0.5.
dangerousGoogle Safe Browsing match or score above 0.5.

Check usage

GET/v1/usage
curl "https://api.useglance.io/v1/usage" \
  -H "Authorization: Bearer glance_..."

Response format

All successful responses return JSON with the following fields.

{
  "url":              "https://github.com/vercel/next.js",
  "title":            "Next.js: The React Framework",
  "description":      "Next.js enables you to create full-stack web apps…",
  "og_image":         "https://api.useglance.io/v1/img/abc123",
  "favicon":          "https://github.com/favicon.ico",
  "site_name":        "GitHub",
  "content_type":     "repo",
  "source":           "generated",
  "confidence":       0.95,
  "safety": {                          // present when ?safety=true
    "risk_level":   "safe",
    "risk_score":   0.02,
    "threat_types": []
  },
  "cached":           false,
  "cached_at":        null,
  "processing_time_ms": 1240
}

content_type values

articleproductrepoprofilelandingvideoother

source values

existingOG tags were present and high quality, used as-is.
generatedAI generated the title and/or description from page content.
hybridOG tags were partially used and partially overridden by AI.

Error codes

StatusMeaning
400Missing or invalid url parameter.
401Missing or invalid Authorization header.
429Monthly enrichment quota exceeded.
500Internal error. The URL may be unreachable or unsupported.

Rate limits

Limits are per-key, per calendar month. There is no per-second rate limit on any plan. If you exceed your monthly quota, all further requests return 429 until the quota resets or you upgrade.

See the pricing page for quota limits per plan.