ByteChef LogoByteChef

SpecStream

SpecStream is a live web data engine. It searches the web for answers with sources and extracts the main text of web pages and documents.

Categories: Helpers, Artificial Intelligence

Type: specstream/v1


Connections

Version: 1

API Key

Properties

NameLabelTypeDescriptionRequired
tokenAPI KeySTRINGSpecStream API key. Create it in your SpecStream workspace under Agents & API. The key must have the finds:spend scope.true

Connection Setup

Create an API Key

  1. Sign in to your SpecStream workspace. If you do not have an account, create one.
  2. Open Agents & API at https://specstream.ai/workspace/agents?tab=keys.
  3. Create an API key.
  4. Give the finds:spend scope to the API key. Without this scope, SpecStream refuses each call.
  5. Set a spending limit for the API key.
  6. Copy the API key.
  7. Paste the API key into the API Key field.

Keep the API key secret. Do not put the API key in workflow parameters or in logs.

Billing

SpecStream charges each call to the balance of your workspace. The Fast search tier costs less than the Default search tier. SpecStream does not charge for a page that has no text. For the current prices, refer to SpecStream Pricing and Billing.

Additional Resources


Actions

Name: webSearch

Searches the live web for a query. Returns an answer or structured rows, and the ranked source pages that support each value.

Properties

NameLabelTypeDescriptionRequired
qSearch QuerySTRINGQuestion or request in plain words, in any language, from 1 to 2000 characters. Accepts the operators site:, -site:, -word, -"phrase", filetype:, after: and before: (YYYY, YYYY-MM or YYYY-MM-DD).true
speedSearch TierSTRING
Options default, fast
Default reads the result pages and returns an answer, structured rows and sources. Fast returns only the search engine results with snippets in about 1 second, with no answer, rows or passages. Fast costs less per call.false
numNumber of SourcesINTEGERMaximum number of sources to return: 1 to 100, or 1 to 200 when Image Search is true. If empty, the response contains all sources that the answer used.false
pageResult PageINTEGERPage of the ranked source list to return, from 1 to 10. Each page has Number of Sources results (10 if empty). Only page 1 contains the answer and the rows.false
passagesReturn Page PassagesBOOLEAN
Options true, false
If true, returns text passages from the top source pages that match the query. Adds up to about 1 second. Do not use together with News Search.false
newsNews SearchBOOLEAN
Options true, false
If true, returns news items, newest first, instead of web results. Always uses the Fast search tier. Do not use together with Return Page Passages.false
imagesImage SearchBOOLEAN
Options true, false
If true, returns image results instead of web results. Always uses the Fast search tier and HTTP POST.false
countryCountry CodeSTRINGTwo-letter ISO 3166-1 code of the country that the results are for. SpecStream sends it to each search engine that can use a country code.false
languageLanguage CodeSTRINGTwo-letter ISO 639-1 code of the result language. SpecStream sends it to each search engine that can use a language code.false
safeSafe Search LevelSTRING
Options off, moderate, strict
Filter level for explicit content. SpecStream sends it to each search engine that can use a level. If empty, each search engine uses its own default level.false
useHttpPostSend as HTTP POSTBOOLEAN
Options true, false
If true, sends the request as HTTP POST with the parameters in a JSON body. If false, sends the request as HTTP GET with the parameters in the URL query. Image Search always uses HTTP POST.false

Example JSON Structure

{
  "label" : "Web Search",
  "name" : "webSearch",
  "parameters" : {
    "q" : "",
    "speed" : "",
    "num" : 1,
    "page" : 1,
    "passages" : false,
    "news" : false,
    "images" : false,
    "country" : "",
    "language" : "",
    "safe" : "",
    "useHttpPost" : false
  },
  "type" : "specstream/v1/webSearch"
}

Output

Type: OBJECT

Properties

NameTypeDescription
dataOBJECT
Properties {STRING(id), STRING(request_id), STRING(query), STRING(kind), [STRING](columns), {STRING(value), STRING(page), STRING(seen_at), BOOLEAN(confirmed), [STRING](sources)}(answer), [{STRING(name), STRING(page), STRING(snippet), NUMBER(probability), {}(fields), [INTEGER](sources)}](rows), [{STRING(url), STRING(title), STRING(site), STRING(snippet), BOOLEAN(cited), STRING(published), STRING(modified), STRING(file_type)}](sources), [{STRING(url), STRING(title), STRING(text)}](passages), INTEGER(page), INTEGER(next_page), STRING(corrected_query), INTEGER(took_ms), NUMBER(price_usd)}

Output Example

{
  "data" : {
    "id" : "",
    "request_id" : "",
    "query" : "",
    "kind" : "",
    "columns" : [ "" ],
    "answer" : {
      "value" : "",
      "page" : "",
      "seen_at" : "",
      "confirmed" : false,
      "sources" : [ "" ]
    },
    "rows" : [ {
      "name" : "",
      "page" : "",
      "snippet" : "",
      "probability" : 0.0,
      "fields" : { },
      "sources" : [ 1 ]
    } ],
    "sources" : [ {
      "url" : "",
      "title" : "",
      "site" : "",
      "snippet" : "",
      "cited" : false,
      "published" : "",
      "modified" : "",
      "file_type" : ""
    } ],
    "passages" : [ {
      "url" : "",
      "title" : "",
      "text" : ""
    } ],
    "page" : 1,
    "next_page" : 1,
    "corrected_query" : "",
    "took_ms" : 1,
    "price_usd" : 0.0
  }
}

Extract Page Content

Name: extract

Reads up to 20 web pages or documents (PDF, Word, Excel, EPUB) and returns the main text of each, without menus, footers and ads, as Markdown, plain text or HTML.

Properties

NameLabelTypeDescriptionRequired
urlsPage URLsARRAY
Items [STRING]
Public HTTP or HTTPS URLs of the web pages or documents to read, from 1 to 20. SpecStream reads a duplicate URL only once.true
formatText FormatSTRING
Options markdown, text, html
Format of the main text in the text field of each result.false
includeAdditional Result FieldsARRAY
Items [STRING]
Fields to add to each result: the raw page HTML, the links on the page, the HTTP response (status code and final URL after redirects), or the full page text.false

Example JSON Structure

{
  "label" : "Extract Page Content",
  "name" : "extract",
  "parameters" : {
    "urls" : [ "" ],
    "format" : "",
    "include" : [ "" ]
  },
  "type" : "specstream/v1/extract"
}

Output

Type: OBJECT

Properties

NameTypeDescription
dataOBJECT
Properties {STRING(request_id), [{STRING(url), STRING(status), STRING(reason), STRING(title), STRING(text), BOOLEAN(text_truncated), STRING(published), STRING(modified), STRING(read_from), STRING(captured_at), STRING(read_from_url), [{STRING(address), STRING(found_in)}](emails), STRING(html), BOOLEAN(html_truncated), STRING(full_text), BOOLEAN(full_text_truncated), [{STRING(url), STRING(text)}](links), INTEGER(status_code), STRING(final_url)}](results), INTEGER(took_ms), NUMBER(price_usd)}

Output Example

{
  "data" : {
    "request_id" : "",
    "results" : [ {
      "url" : "",
      "status" : "",
      "reason" : "",
      "title" : "",
      "text" : "",
      "text_truncated" : false,
      "published" : "",
      "modified" : "",
      "read_from" : "",
      "captured_at" : "",
      "read_from_url" : "",
      "emails" : [ {
        "address" : "",
        "found_in" : ""
      } ],
      "html" : "",
      "html_truncated" : false,
      "full_text" : "",
      "full_text_truncated" : false,
      "links" : [ {
        "url" : "",
        "text" : ""
      } ],
      "status_code" : 1,
      "final_url" : ""
    } ],
    "took_ms" : 1,
    "price_usd" : 0.0
  }
}

What to do if your action is not listed here?

If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.

To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.

How is this guide?

Last updated on

On this page