Docs
View as Markdown

web.text

stable Advanced

Main content of a page as plain text (readability-style).

GET /v1/web/text

What you get#

One Web record in Onekey's unified shape, in data. If the record does not exist you get a 404 not_found and are not charged.

Also known as: /web/scrape on APIs that nest their paths. See Alternatives and equivalents.

What it costs#

  • Advanced · 5 credits for a fresh fetch, charged only when it succeeds.
  • Free when served from cache (0.2 credit for a cached response over 100 KB).
  • Free if the request is invalid (never charged) or the source fails or reports not found (refunded).

Parameters#

NameTypeRequiredDefaultWhat it isConstraints
urlstringyes(required)Absolute http(s) URL of the page (ports 80/443 only; private/internal hosts are refused)max 2048 chars; must match https?://[A-Za-z0-9](?:[A-Za-z0-9.-]{0,251}[A-Za-z0-9])?(?::(?:80|443))?(?:[/?][\x21-\x5b\x5d-\x7e]*)?; trimmed

Request#

curl "https://api.onekey.dev/v1/web/text?url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWeb_scraping" \
  -H "x-api-key: YOUR_API_KEY"

Try it

Add your key to run this call right here. No key? Get one free. The key stays in this tab.

Recorded response#

A real Web response, recorded and returned in Onekey's shape. Fields the platform does not provide are null.

json
{
  "success": true,
  "data": {
    "content": {
      "title": "Web scraping - Wikipedia",
      "text": "Web scraping\n\nFrom Wikipedia, the free encyclopedia\n\nFor broader coverage of this topic, see Data scraping.\n\n\"Web scraper\" redirects here. For websites that scrape content, see Scraper site.\n\n\tThis article needs more citations. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: \"Web scraping\" – news · newspapers · books · scholar · JSTOR (April 2023) (Learn how and when to remove this message)\n\nWeb scraping, web harvesting, or web data extraction is data scraping used for extracting data from websites.[1] Web scraping software may directly access the World Wide Web using the Hypertext Transfer Protocol or a web browser. While web scraping can be done manually by a software user, the term typically refers to automated processes implemented using a bot or web crawler. It is a form of copying in which specific data is gathered and copied from the web, typically into a central local database or spreadsheet, for later retrieval or analysis.\n\nScraping a web page involves fetching it and then extracting data from it. Fetching is the downloading of a page (which a browser does when a user views a page). Therefore, web crawling is a main component of web scraping, to fetch pages for later processing. Having fetched, extraction can take place. The content of a page may be parsed, searched and reformatted, and its data copied into a spreadsheet or loaded into a database. Web scrapers typically take something out of a page, to make use of it for another purpose somewhere else. An example would be finding and copying names and telephone numbers, companies and their URLs, or e-mail addresses to a list (contact scraping). Another example is collecting competitors product prices for marketing purposes, which can involve gathering large-scale pricing datasets from e-commerce websites and analysing them using data science techniques such as trend analysis, predictive modelling, and competitive benchmarking.\n\nContact scraping is a type of web scraping that is used as a component of applications used for web indexing, web mining and data mining, online price change monitoring and price comparison, product review scraping (to watch the competition), gathering real estate listings, weather data monitoring, website change detection, research, tracking online presence and reputation, web mashup, and web data integration.\n\nWeb pages are built using text-based markup languages (HTML and XHTML), and frequently contain a wealth of data in text form. However, most web pages are designed for human end-users and not for ease of automated use. As a result, specialized tools and software have been developed to facilitate the scraping of web pages. Web scraping applications include market research, price comparison, content monitoring and artificial intelligence. Businesses rely on web scraping services to efficiently gather and use this data.\n\nThere are methods that some websites use to prevent",
      "url": "https://en.wikipedia.org/wiki/Web_scraping",
      "language": "en",
      "createdAt": "2005-09-17T18:57:30Z"
    },
    "author": {
      "displayName": "Contributors to Wikimedia projects"
    },
    "entity": {
      "name": null
    },
    "ext": {
      "wordCount": 4414,
      "readingTimeMinutes": 21,
      "excerpt": "Web scraping From Wikipedia, the free encyclopedia For broader coverage of this topic, see Data scraping. \"Web scraper\" redirects here. For websites that scrape content, see Scraper site. This article needs more citations. Please help improve this article by adding citations to reliable sources. Uns"
    },
    "media": {
      "url": null
    }
  },
  "metadata": {
    "platform": "web",
    "endpoint": "text",
    "cached": false,
    "stale": false,
    "age_s": 0,
    "fetched_at": "2026-01-01T12:00:00+00:00",
    "credits_charged": 5,
    "request_id": "7f3a9c2e5b1d4c8fa2e6d0b9c4f18e37"
  },
  "error": null
}

Field mapping#

How this endpoint's source fields become Onekey's unified schema. Fields the source lacks come back as null.

Source pathOnekey fieldTransform
titlecontent.title-
textcontent.text-
finalUrlcontent.urlsafeUrl
languagecontent.language-
publishedAtcontent.createdAttoIsoDate
bylineauthor.displayName-
siteNameentity.name-
wordCountext.wordCounttoNumber
readingTimeMinutesext.readingTimeMinutestoNumber
excerptext.excerpt-
imageUrlmedia.urlsafeUrl

Caching and freshness#

  • Fresh for about 10 minutes. Repeat calls in that window are served from cache and are free.
  • Between 10 minutes and 1 hour the cached copy is still served instantly and marked stale: true while Onekey refreshes it in the background.
  • If the source is down when a refresh is needed, the last copy can be served for up to 1 hour more (marked stale).
  • A "not found" is remembered for 2 minutes and is free.
  • The cache is shared across all customers, which is what keeps repeat calls cheap.

What can go wrong#

StatusCodeWhat to do
401unauthorizedCheck the x-api-key header.
402insufficient_creditsAdd credits; your balance must cover the price.
404not_foundThat record does not exist. Free; do not retry.
422invalid_paramsFix the parameters using the table above. Free.
429rate_limitedWait Retry-After seconds, then retry.
502upstream_errorThe source failed. Refunded; retry with backoff.

See Errors for the full list and retry guidance.

Status: stable (verified against the live source).