POST /api/extract runs Truscan’s extractor on URLs you supply. It is the same
extractor that fills content on search results, reached directly.
string[]
required
Between 1 and 8 absolute
http or https URLs.Options
Every option is additive. Omit them all and you get the whole readable body, which is what search asks for.integer
Caps the emitted text. The page is still fetched and parsed in full, so
words and excerpt describe the page rather than the slice you kept, and
truncated reports that the cut happened.boolean
Drops
text and markdown, keeping the excerpt, the metadata and anything
else you asked for. Use it when you want highlights or links and would
otherwise pay to move an entire page over the wire to throw it away.string
Scores the page’s sentences against this query and returns the best matching
passages with their offsets into
text.integer
default:"3"
How many passages to return. Clamped to 20.
boolean
Collects the article’s outbound links and images as absolute URLs. Taken from
the extracted article, not the whole document: a page’s navigation is the same
on every page of the site and is never what you meant.
Options only ever narrow or annotate the response. Billing counts pages read,
so asking for highlights or dropping the body changes what comes back, never
what it costs. The fetch and the parse happened either way.
Response
result is an object keyed by the URL you submitted, so you can look each one
up directly:
Partial failures
A URL that cannot be fetched or parsed does not fail the request. Its entry carries anerror instead of content, so always check before reading text:
Cost
Extraction is billed at $1.00 per 1,000 pages, counted per URL successfully extracted. A page that returns anerror is not billed.
Freshness
POST /api/extract always fetches. Call it when you need the page as it is
right now, and that is the reason to use it rather than a search.
Page text extracted during a search is different: it is held for up to seven
days and reused, so a result can carry body text older than the search that
returned it. For articles and documentation that is what you want, and ranking
is always computed fresh regardless.
A cached page costs the same as a fetched one. The cache makes a search faster,
not cheaper.