Extract any page as markdown or text
Send up to 20 URLs in one call and get the main text of each, without its menus, footers, and ads. A page that refuses a plain read is tried again, and read_from says where the text came from.
curl https://api.specstream.ai/v1/extract \ -H "Authorization: Bearer $SPECSTREAM_API_KEY" \ -H "Content-Type: application/json" \ -d '{"urls": ["https://en.wikipedia.org/wiki/Narbonne"], "format": "markdown"}'
{
"data": {
"results": [
{
"url": "https://en.wikipedia.org/wiki/Narbonne",
"status": "ok",
"title": "Narbonne - Wikipedia",
"published": "2002-10-11T13:08:41+00:00",
"read_from": "live",
"text": "... ## Etymology\n\nThe etymology of the town's original name, **Narbo**, is lost in antiquity ..."
}
],
"took_ms": 441,
"price_usd": 0.0008
}
}$0.80
per 1,000 pages read
Pages read, from your balance. A page with no text is not charged.
- 20 URLs a call
- Send 1 to 20 http or https URLs. The same URL twice is read once.
- PDF, Word, Excel
- Documents come back as markdown or plain text, the same as a web page.
What a call returns
One result for each URL, in the order you sent them, then the request_id and took_ms of the call.
- url and status
- Each URL and how its read went: ok, blocked, not_found, empty, unsupported, invalid_url, or failed. ok means read and charged.
- text
- The page's main text. Markdown keeps headings, lists, and links. Text returns it plain.
- published
- The date the page says it was published, when it says one. The page's title comes with it.
- read_from
- live for the page now, site for the same page from the site's own API or feed, archive for its newest public web archive capture, with the capture's time in captured_at.
- price_usd
- The price of the pages read in this call.
How a refused page is read
A page that refuses a plain read is tried again in this order, and read_from says where the text came from.
As a browser
The request goes out again the way a browser would ask for the page.
In a real browser
If that is refused too, the page opens in a real browser and the text is read there.
From the site's feed
Next, the same page comes from the site's own API or feed, and read_from is site.
From the newest public archive capture
Last, the text comes from the newest public web archive capture. read_from is archive, and captured_at gives its time.
Extract API questions
Something we didn't answer? Talk to a human
What does a page cost?
What if a page still can't be read?
Which formats does it return?
Can I retry a call safely?
Extract your first page
Sign up and get $10 of credit, no card.