# ogfetch > ogfetch is a URL metadata API. Send it any URL and get back clean JSON: page title, description, Open Graph tags (og:title, og:image, ...), Twitter card tags, favicon, canonical URL, author, keywords, word count, HTTP status, response time, and the detected tech stack (Next.js, WordPress, Shopify, Vercel, Cloudflare and more). It is built for link previews, URL unfurling, SEO audits, and AI agents that need to understand a link without loading a browser. ogfetch is fully headless. An AI agent can create an account, get an API key, check its balance, buy credits, and call the API without a human, email, or browser. Agents with a Solana wallet can pay in USDC entirely on their own; card payments go through a Stripe checkout link. Pricing is one-time credit packs with no subscription: $3 for 1,000 requests, $10 for 5,000, $20 for 15,000. Credits never expire. New agent accounts get 20 free credits. ## Quickstart for agents 1. Get a key (no auth, no email): `curl -X POST https://ogfetch.dev/v1/signup` Response includes `api_key` (starts with `ogf_`). Store it; it is shown only once. 2. Fetch metadata: `curl -G https://ogfetch.dev/v1/fetch -H "Authorization: Bearer ogf_..." --data-urlencode "url=https://github.com"` 3. Check balance: `curl https://ogfetch.dev/v1/account -H "Authorization: Bearer ogf_..."` 4. Buy credits, either way: - **USDC on Solana via Solana Pay (autonomous):** `curl -X POST https://ogfetch.dev/v1/topup/solana -H "Authorization: Bearer ogf_..." -H "Content-Type: application/json" -d '{"plan":"starter"}'` Returns `transaction_url`, `status_url`, `solana_pay_url`, `amount_usdc`, and a `reference`. Then: `curl -X POST -H "Content-Type: application/json" -d '{"account":""}'` The response `transaction` is a base64 unsigned Solana transaction (USDC transfer, fee payer = your wallet, everything filled in). Deserialize, sign with your wallet, and send it. Then poll `status_url` every few seconds until `status` is `credited`. This is a standard Solana Pay transaction request; humans can scan `solana_pay_url` as a QR code in Phantom, or use https://ogfetch.dev/topup/. - **Card (Stripe):** `curl -X POST https://ogfetch.dev/v1/checkout -H "Authorization: Bearer ogf_..." -H "Content-Type: application/json" -d '{"plan":"starter"}'` Returns `checkout_url`. Whoever opens it can pay. Credits land on the same key automatically. When credits run out, `/v1/fetch` returns HTTP 402 with code `NO_CREDITS` and a `buy` object describing exactly how to top up. ## MCP server Remote MCP server (Streamable HTTP): `https://ogfetch.dev/v1/mcp` Auth: `Authorization: Bearer ogf_...` header (or pass `api_key` as a tool argument). Tools: `fetch_url_metadata`, `create_account`, `get_account`, `get_pricing`, `buy_credits` (card), `buy_credits_usdc` + `check_usdc_payment` (USDC on Solana via Solana Pay). Claude Code: `claude mcp add --transport http ogfetch https://ogfetch.dev/v1/mcp --header "Authorization: Bearer ogf_..."` Generic MCP client config: ```json { "mcpServers": { "ogfetch": { "type": "http", "url": "https://ogfetch.dev/v1/mcp", "headers": { "Authorization": "Bearer ogf_..." } } } } ``` ## API reference - `POST /v1/signup` - create account + API key. Optional JSON body `{"name": "...", "contact": "..."}`. Limit 3 per IP per day. - `GET /v1/fetch?url=` (or `POST /v1/fetch` with `{"url": "..."}`) - metadata for a URL. 1 credit per successful fetch. - `GET /v1/account` - credits remaining and usage. - `GET /v1/pricing` - credit packs. No auth. - `POST /v1/checkout` - body `{"plan": "starter" | "pro" | "business"}`. Returns Stripe `checkout_url`. - `POST /v1/topup/solana` - body `{"plan": ...}`. Returns a Solana Pay quote: `transaction_url`, `solana_pay_url`, `amount_usdc`, `reference`, `status_url`, `expires_at` (24h). - `POST /v1/topup/solana/{reference}/tx` - Solana Pay transaction request. Body `{"account": ""}`. Returns `{"transaction": "", "message": "..."}`. - `GET /v1/topup/solana/{reference}` - payment status (`pending`, `credited`, `expired`). Finds the payment on-chain by reference and adds credits exactly once. Safe to poll. - `GET /v1/` - machine-readable index of all endpoints. Auth: `Authorization: Bearer ` or `X-Api-Key: `. Errors are JSON: `{"error": "", "code": ""}`. Codes: MISSING_KEY, INVALID_KEY, NO_CREDITS, MISSING_URL, INVALID_URL, RATE_LIMITED, FETCH_FAILED, TIMEOUT, INVALID_PLAN, CHECKOUT_FAILED, INVALID_REFERENCE, INVALID_ACCOUNT, QUOTE_NOT_FOUND, QUOTE_EXPIRED, ALREADY_PAID, CANNOT_BUILD, UNDERPAID, RPC_ERROR. ## Response shape ```json { "url": "https://github.com/", "canonical": "https://github.com/", "title": "GitHub: Let's build from here", "description": "GitHub is where over 100 million developers shape the future of software.", "favicon": "https://github.githubassets.com/favicons/favicon.svg", "og": { "title": "...", "description": "...", "image": "https://...", "url": "...", "type": "website", "siteName": "GitHub" }, "twitter": { "card": "summary_large_image", "title": "...", "description": "...", "image": "...", "creator": null }, "meta": { "author": null, "keywords": null, "robots": null, "themeColor": "#1e2327" }, "wordCount": 1234, "techStack": ["React", "GitHub Pages"], "statusCode": 200, "responseTime": 312, "fetchedAt": "2026-11-03T12:00:00.000Z" } ``` All fields are always present; missing values are `null`. Image and favicon URLs are absolute. ## Limits - Plain HTTP fetch, no JavaScript rendering. Metadata injected client-side after load is not captured. - 10 second timeout per target URL. ## Docs - [API documentation](https://ogfetch.dev/docs/): full reference for humans - [For AI agents](https://ogfetch.dev/agents/): headless signup, payment, and MCP setup - [OpenAPI spec](https://ogfetch.dev/openapi.json): OpenAPI 3.1 description of every endpoint - [Pricing](https://ogfetch.dev/#pricing) ## Comparisons - [Microlink alternative](https://ogfetch.dev/compare/microlink-alternative/) - [OpenGraph.io alternative](https://ogfetch.dev/compare/opengraph-io-alternative/) - [LinkPreview alternative](https://ogfetch.dev/compare/linkpreview-alternative/)