Get contents

Metadata and short verbatim excerpts of up to 10 URLs.

POSThttps://api.typesearch.ai/v1/contents

Returns, for each URL, its title, the description its publisher gives it, its publication date, its source and a very short verbatim excerpt (up to 25 words, never from the first paragraph) — never the full text. With a query, the model picks the excerpt about it and scores each page’s relevance. Articles that can’t be quoted (short, paid, or whose publisher asked for no snippets) come back without an excerpt.

Each URL has its own status: one that fails never fails the request.

Body

  • urlsuri[]required

    Up to 10 full URLs.

    Items: up to 10

  • querystring

    When set, the model picks the excerpt about this query and scores each page’s relevance.

  • highlightsbooleanDefault: true

    Return a short verbatim excerpt: up to 25 words, never from the first paragraph. Defaults to true.

  • max_tokensinteger | null

    A hard cap on model tokens for this request, minimum 2000. If it is reached, you get everything judged so far with incomplete: true.

    Range: 2000–9007199254740991

Response

  • idstring

    The request id.

  • object"contents"

    Always contents.

  • resultsobject[]

    One entry per URL, in the order they were sent.

    Show child attributes
    • urlstring

      The article’s canonical URL.

    • statusenum<string>

      ok or error. A failing URL never fails the whole request.

    • errorobject | null

      When status is error: the reason, such as source_unavailable when the source isn’t available right now (we don’t say why, and it may be temporary).

      Show child attributes
      • codestring

        A stable code.

      • messagestring

        A human-readable explanation.

    • titlestring | null

      The headline, up to 240 characters.

    • descriptionstring | null

      The description the page declares, up to 300 characters.

    • published_atstring | null

      Publication time, ISO 8601 in UTC.

    • sourcestring | null

      The publication.

    • excerptstring | null

      A very short verbatim excerpt (up to 25 words), never from the first paragraph: the one about query when one was sent. null when the article can’t be quoted: it’s short, it’s paid, or its publisher asked for no snippets.

    • highlightsstring[]

      A short verbatim excerpt, about query when one was sent: up to 25 words, never from the first paragraph. None for short articles.

    • relevancenumber | null

      With query: the probability that the page is about it.

  • usageobject

    What the request consumed.

    Show child attributes
    • tokensinteger

      Model tokens. 0 when served from cache.

      Range: -9007199254740991–9007199254740991

    • callsinteger

      Model calls.

      Range: -9007199254740991–9007199254740991

    • cost_usdnumber | null

      Cost in US dollars, when known.

    • duration_msinteger

      Time on the server, in milliseconds.

      Range: -9007199254740991–9007199254740991