{"uid":"cap_DB5-rNzNBhskzbvjXroYc","slug":"2s-ai-extract-structured-data-extraction-from-url-9052d70e","name":"2s AI Extract — Structured Data Extraction from URL","description":"The (most) everything API: 575+ pay-per-call endpoints for AI agents — ground-truth data, a full AI gateway, and agent infrastructure (storage, queues, watchers). USDC via x402, no signup, no API keys, and upto billing: pay actual usage, not the quote.","url":"https://2s.io/api/ai/extract","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048},"schema":{"type":"object","additionalProperties":{}},"instruction":{"type":"string","maxLength":2000}}},"responseSchema":null,"example":{"request":{"url":"https://example.com","schema":{"type":"object","properties":{"company":{"type":"string"},"founded_year":{"type":"number"},"headquarters":{"type":"string"}}},"instruction":"Extract the company name, founding year, and headquarters location from the webpage content."},"response":{"data":{"ok":true,"items":[{"url":"https://example.com","finalUrl":"https://example.com/","extracted":{"company":"null","founded_year":"null","headquarters":"null"},"truncated":false}],"total":1,"source":{"url":"https://2s.io","license":"Generated content — no upstream data license","provider":"2s.io AI (Anthropic Claude Haiku)"}},"meta":{"cost":{"usd":0.075,"tier":2},"caller":"x402","version":null,"endpoint":"ai.extract","settlement":{"txHash":"0x3bc712fc9179bed4b14d2916dff94cd17720061e7f770dc6192d37a66a005480","network":"eip155:8453","success":true}}}},"exampleRequest":{"url":"https://example.com","schema":{"type":"object","properties":{"company":{"type":"string"},"founded_year":{"type":"number"},"headquarters":{"type":"string"}}},"instruction":"Extract the company name, founding year, and headquarters location from the webpage content."},"tags":["x402"],"displayCostAmount":"0.075","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.075/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1875","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1875","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ILzbc--yB9Q0ZUs2Aqj1P","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.1875","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fetches a URL and extracts structured data from its content according to a caller-supplied JSON Schema and optional natural-language instruction","exampleAgentPrompt":"Go to https://news.ycombinator.com/item?id=12345 and extract the post title, author, score, and top 3 comments into a structured object — use the schema {title: string, author: string, score: number, topComments: array of strings}.","exampleUseCases":null,"resultDescription":"Returns a JSON object with an 'items' array where each item contains the requested URL, the final URL after any redirects, the 'extracted' object conforming to the caller-supplied JSON Schema, and a 'truncated' boolean indicating if the page was too long to process fully. Also includes source provenance (provider, URL, license) and a total count.","failureModes":["URL is unreachable or returns a non-200 status — items array may be empty or contain partial data","Page content is truncated before extraction due to length — truncated field will be true and extracted data may be incomplete","Caller-supplied schema does not match page content — extracted object may have null or missing fields","Invalid URL format — request rejected with validation error","Rate limit or payment failure — HTTP 402 response requiring USDC payment on Base or Solana"],"whenToPreferThis":"Use this endpoint when you need to extract typed, schema-conforming structured data from a specific URL in a single call, especially when you want to define exactly which fields to pull using your own JSON Schema. Prefer this over generic scrapers when you need clean structured output rather than raw HTML, and when you want pay-per-call pricing with no API key setup.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:53:06.022Z","isFirstParty":false}