Apinoa Docs

Web API

Any public web page: read it as Markdown with the Web Reader, or send your own HTTP request and get the site's answer back with the Web Unlocker.

View raw .mdx

The Web API works on public web pages that no other apinoa API covers. It has two products:

  • Web Reader reads a page. You pass its address and get its main content as Markdown, its title and metadata (description, author, publication date, site name, language, lead image, favicon) and every schema.org JSON-LD block on it.
  • Web Unlocker sends your own HTTP request (the method, headers and body you choose) and returns the site's answer as it arrived: its status, its headers and its body.
curl -G "https://gateway.apinoa.com/v1/reader/page" --data-urlencode "url=https://stephango.com/saw" \
  -H "x-api-key: $APINOA_API_KEY"
curl -X POST "https://gateway.apinoa.com/v1/unlocker/request" \
  -H "x-api-key: $APINOA_API_KEY" -H "Content-Type: application/json" \
  -d '{"url": "https://httpbin.org/anything?q=shoes", "method": "POST", "headers": {"content-type": "application/json"}, "body": "{\"q\":\"shoes\"}"}'

Operations

OperationEndpointReturnsWhat It Does
reader/pageGET | POST /v1/reader/pageReaderPageReads a page at url as Markdown, with its metadata and JSON-LD
unlocker/requestPOST /v1/unlocker/requestUnlockResultSends your request to url and returns the site's status, headers and body

Which One to Use

You WantUse
The text of an article, a docs page, a blog post or a product page, ready for a model or a search indexWeb Reader
A page's title, author, date and schema.org JSON-LDWeb Reader
To call an API with your own key, post a form, or fetch JSON, XML or a fileWeb Unlocker
The site's exact answer: its status, every header, its cookies, its body byte for byteWeb Unlocker
Data from a platform apinoa has its own API for (Amazon, Walmart, Google, YouTube, Reddit, TikTok, Instagram, …)That platform's API. It returns structured data, and the Web Unlocker refuses those sites, naming the API to call

The Web Reader also returns the page's HTML on request (include=html), so a page you want both as Markdown and as HTML is one call.

What Is the Same Everywhere

  • Sent as a real browser. Every request goes out with a real browser's identity, and a request a site blocks is retried automatically. A page that is still behind a bot check is an error, UPSTREAM_UNAVAILABLE, and is not billed: a bot-check page is never returned as if it were the site's answer.
  • The site's status is the site's. A 404 page, a 500 or a plain 403 is what the site answered. It is returned with its status in status, and billed. Check status before you use the content.
  • Redirects are followed. The address that finally answered is in finalUrl (Reader) or url (Unlocker).
  • Public sites only. Private and internal addresses (localhost, 10.0.0.0/8, 192.168.0.0/16 and the like) are refused with INVALID_PARAMS.
  • Certificates are checked. A site whose TLS certificate is not valid is not reached: the call fails with UPSTREAM_UNAVAILABLE.
  • No JavaScript is run. Both return what the site's server sends. A page that builds its content in the browser with JavaScript comes back with little or no text; call the JSON endpoint it loads its data from instead, with the Web Unlocker.
  • Country. Requests are sent from the US (country=US, the only value).

Billing

  • Web Reader: 1 credit a page, up to 5 MiB.
  • Web Unlocker: 1 credit per started MiB of the answer's body: up to 1 MiB costs 1 credit, 1.2 MiB costs 2 credits, and the largest answer, 10 MiB, costs 10 credits.
  • A site's own error page is an answer, and is billed. A call that fails with an error is not.

Errors

The same envelope and codes as the rest of the API. See Errors.

StatusCodeWhen
400INVALID_PARAMSA parameter is missing or out of range; the address is private or internal; (Reader) the address is not a web page, such as a PDF or an image, and the message names its content type; (Unlocker) the site is one the Unlocker does not send to, and the message names the API to call instead
400UPSTREAM_TOO_LARGEThe answer is larger than the limit: 5 MiB for the Reader, 10 MiB for the Unlocker
503UPSTREAM_UNAVAILABLEThe site stayed behind a bot check, or could not be reached (no such host, connection refused, invalid certificate). Retry later

Failed calls are not billed.

Reference

On this page