Skip to content

Exa

Exa web search, page contents, similar pages and cited answers for Sanoma workflows.

Package @sanoma-ai/connector-exa, version 0.11.24. Its README, with how to install and connect it, is on GitHub.

web

exa.web.searchreadsafe to retry

Search the web, and return the pages found, with their text, highlights or summary if asked.

Input

  • querystringrequired

    at least 1 character

  • type"auto" | "neural" | "lite"

    How Exa searches: auto by default, lite the cheapest (beta)

  • category"company" | "publication" | "news" | "personal site" | "financial report" | "people"

    The kind of page to look for

  • numResultsinteger

    How many results, 10 by default

    at least 1, at most 100

  • includeDomainsstring[]

    Only results from these domains

    each item: at least 1 character

  • excludeDomainsstring[]

    No results from these domains

    each item: at least 1 character

  • startPublishedDatestring

    Only pages published after this date

    at least 1 character

  • endPublishedDatestring

    Only pages published before this date

    at least 1 character

  • contentsobject

    What of each page to return with it

    Fields
    • texttrue | object

      The page's text, all of it or up to maxCharacters

      Fields
      • maxCharactersinteger

        more than 0

    • highlightstrue | object

      The passages of the page most relevant to the query, or to query

      Fields
      • maxCharactersinteger

        more than 0

      • querystring

        at least 1 character

    • summaryobject

      A summary of the page, written for query when given

      Fields
      • querystring

        at least 1 character

    • maxAgeHoursinteger

      The oldest cached copy to use, in hours, else Exa fetches the page again: 0 always, -1 never

      at least -1

Output

  • resultsobject[]required
    Each item
    • idstringrequired
    • urlstringrequired
    • titlestring | null
    • authorstring | null
    • publishedDatestring | null
    • scorenumber | null
    • imagestring | null
    • faviconstring | null
    • textstring
    • highlightsstring[]
    • summarystring

getContents

exa.web.getContentsreadsafe to retry

Read pages by URL: their text, highlights or summary.

Input

  • urlsstring[]required

    at least 1 item, each item: format uri

  • texttrue | object

    The page's text, all of it or up to maxCharacters

    Fields
    • maxCharactersinteger

      more than 0

  • highlightstrue | object

    The passages of the page most relevant to the query, or to query

    Fields
    • maxCharactersinteger

      more than 0

    • querystring

      at least 1 character

  • summaryobject

    A summary of the page, written for query when given

    Fields
    • querystring

      at least 1 character

  • maxAgeHoursinteger

    The oldest cached copy to use, in hours, else Exa fetches the page again: 0 always, -1 never

    at least -1

Output

  • resultsobject[]required
    Each item
    • idstringrequired
    • urlstringrequired
    • titlestring | null
    • authorstring | null
    • publishedDatestring | null
    • scorenumber | null
    • imagestring | null
    • faviconstring | null
    • textstring
    • highlightsstring[]
    • summarystring
  • statusesobject[]required
    Each item
    • idstringrequired
    • statusstringrequired
    • errorobject | null
      Fields
      • tagstring
      • httpStatusCodenumber | null

findSimilar

exa.web.findSimilarreadsafe to retry

Find pages like the one at a URL.

Input

  • urlstringrequired

    format uri

  • excludeSourceDomainboolean

    No results from the URL's own domain

  • numResultsinteger

    How many results, 10 by default

    at least 1, at most 100

  • includeDomainsstring[]

    Only results from these domains

    each item: at least 1 character

  • excludeDomainsstring[]

    No results from these domains

    each item: at least 1 character

  • startPublishedDatestring

    Only pages published after this date

    at least 1 character

  • endPublishedDatestring

    Only pages published before this date

    at least 1 character

  • contentsobject

    What of each page to return with it

    Fields
    • texttrue | object

      The page's text, all of it or up to maxCharacters

      Fields
      • maxCharactersinteger

        more than 0

    • highlightstrue | object

      The passages of the page most relevant to the query, or to query

      Fields
      • maxCharactersinteger

        more than 0

      • querystring

        at least 1 character

    • summaryobject

      A summary of the page, written for query when given

      Fields
      • querystring

        at least 1 character

    • maxAgeHoursinteger

      The oldest cached copy to use, in hours, else Exa fetches the page again: 0 always, -1 never

      at least -1

Output

  • resultsobject[]required
    Each item
    • idstringrequired
    • urlstringrequired
    • titlestring | null
    • authorstring | null
    • publishedDatestring | null
    • scorenumber | null
    • imagestring | null
    • faviconstring | null
    • textstring
    • highlightsstring[]
    • summarystring

answer

exa.web.answerreadsafe to retry

Answer a question from a web search, with the pages the answer cites.

Input

  • querystringrequired

    at least 1 character

  • textboolean

    Return each cited page's text too

Output

  • answerstringrequired
  • citationsobject[]required
    Each item
    • idstringrequired
    • urlstringrequired
    • titlestring | null
    • authorstring | null
    • publishedDatestring | null
    • scorenumber | null
    • imagestring | null
    • faviconstring | null
    • textstring
    • highlightsstring[]
    • summarystring

These pages describe sanoma 0.11.24.