> SpecStream is the live web data engine for teams and agents. This is the Markdown copy of https://specstream.ai/docs/integrations/dify. Every page, with what SpecStream does and costs: https://specstream.ai/llms.txt

# Dify

Give a Dify agent or workflow live web data. The SpecStream plugin adds a tool that finds rows from a request in plain words, within a maximum price you set, and a tool that reads them back later.

[SpecStream for Dify, Agent frameworks & builders](https://specstream.ai/integrations/dify.md)

## What you need

-   Dify 1.0.0 or later.
-   A SpecStream account, free to open. The first $2 of credit needs no card.
-   A SpecStream API key.

1.  1

    ## 1. Install the plugin

    In Dify, open the Marketplace, search for SpecStream, and install the plugin. It connects only to `https://api.specstream.ai`, over HTTPS.

2.  2

    ## 2. Create an API key

    Go to **Agents & API** in SpecStream, open the **API keys** tab and use **Create API key**. Label it for Dify. **Find a List** starts paid work, so keep **Authorize paid work** on. Then click **Set a total limit** and enter the most your agents and workflows may spend with this key.

    Keys expire after 30 days unless you change **Expires after, days**. When the plugin's authorization starts failing, an expired key is the first thing to look for. Copy the key from the next screen, because SpecStream shows it once. A key without **Authorize paid work** can still read lists with **Get List Results**.

3.  3

    ## 3. Authorize the plugin

    Open the SpecStream plugin's authorization in Dify, paste the key into **SpecStream API key** and save. Dify asks SpecStream about the key before it saves, and shows an error if SpecStream doesn't accept it.

4.  4

    ## 4. Add Find a List

    Add **Find a List** to an agent or a workflow. The model fills in **What to find**, the request in plain words, and **Number of results**. You fill in **Maximum price (USD)** and **Wait for results (seconds)** when you add the tool, and the model never sees them.

    SpecStream prices the request before anything starts. If the price is above your maximum, nothing starts. Otherwise the request starts, the tool waits up to the seconds you set, and it returns the rows found so far.

5.  5

    ## 5. Read the rest with Get List Results

    **Get List Results** takes a **List ID**, the `list_id` that **Find a List** returned. It starts with `fnd_`. The tool returns the list's status and its rows.

    Use it when **Find a List** returned before the list finished, or whenever you want the current rows again.

## What the tools return

The tools return JSON with `list_id`, `status`, `number_of_rows`, `list_link`, and `rows`. `status` is one of running, completed, partial, failed, canceled, or expired. `number_of_rows` counts every match, while `rows` holds up to 100 per call, so open `list_link` to see a longer list in your workspace.

Each item in `rows` has the request's columns, keyed by their names, plus these fields. A column named like one of them gets "(column)" added to its name:

| Field | What it holds |
| --- | --- |
| `id` | The list ID and the row's own ID, joined with a colon. |
| `list_id` | The list the row belongs to. |
| `list_link` | Opens the list in your workspace. |
| `position` | The row's place in the list. |
| `source_url` | The page the row's first value came from. |
| `checked_at` | When that page was read. |

## Find a List settings

The model fills in **What to find** and **Number of results**. The other settings are yours.

| Setting | Set by | What it does |
| --- | --- | --- |
| **What to find** | The model | The request in plain words, with the place and the details to bring back. |
| **Number of results** | The model | How many matching rows to look for, from 1 to 1,000. The default is 25. |
| **Maximum price (USD)** | You | The most one request may cost. Above it, nothing starts. |
| **Wait for results (seconds)** | You | How long to wait for rows before returning, from 0 to 150. The default is 90. The list keeps running afterward. |

## Price limit and retries

-   When the most a request could cost is above **Maximum price (USD)**, nothing starts. The tool says what it would have cost.
-   You pay for rows that match.
-   A retry doesn't pay twice. The same request, count, and maximum, sent again within the hour, returns the list that already started.

## If something doesn't work

| What you see | What to do |
| --- | --- |
| Invalid SpecStream API key. | Create a new key and paste it into the authorization again. An expired or deleted key gives this message. |
| Could not verify the API key with SpecStream. Try again in a moment. | SpecStream answered with an error that isn't a rejected key. Save the authorization again in a moment. |
| Could not reach SpecStream. Try again in a moment. | Dify couldn't connect to `api.specstream.ai`. Try again, and write to [support@specstream.ai](mailto:support@specstream.ai) if it keeps happening. |
| SpecStream needs a clearer request before it can price it. | Add the place or more detail to **What to find**. The message quotes how SpecStream read the request. |
| This list can cost up to $X, above the maximum of $Y | Raise **Maximum price (USD)** or lower **Number of results**. Nothing started. |
| `status` is running when the tool returns | The wait ended before the list did. Run **Get List Results** with the `list_id` later. |
| Pass the list ID from Find a List. It starts with `fnd_`. | Give **Get List Results** the `list_id` that **Find a List** returned. |

## What the plugin sends

The plugin sends the text of each request, the number of results, and your maximum price to `api.specstream.ai`, authenticated with your key, and reads back the list's status and rows. It stores nothing, logs nothing, and sends nothing to any other service. SpecStream keeps your lists in your account as the [privacy policy](https://specstream.ai/privacy.md) describes.

## Web search with the Search API

For Dify users: the SearXNG plugin searches with the Search API once you set its base URL. It is separate from the SpecStream plugin above.

Install the **SearXNG** plugin from the Marketplace, open its authorization, and paste this into **SearXNG base URL**, with your key in place of `YOUR_SPECSTREAM_KEY`:

`https://api.specstream.ai/searxng/search?key=YOUR_SPECSTREAM_KEY`

The address then holds your key, so keep it in a secret or an environment setting.

To check it, add **SearXNG Search** to a workflow, give it a **Query string**, and run the step. It returns each result as JSON with its title, URL, and content.

Each search is one Search API call at $5 per 1,000 searches of up to 10 results. It comes out of your balance, with no quote and no approval. [Get your key](https://specstream.ai/workspace/search?route=searxng&utm_source=dify&utm_medium=howto) on the Search API screen of your SpecStream workspace. New accounts start with $2 of credit, no card.

## Brave search with the Search API

For Dify users with the **Brave** plugin: open its authorization, paste this into **Brave server's Base URL**, and put your key in **Brave Search API key**:

`https://api.specstream.ai/res/v1/web/search`

To check it, add the Brave search tool to a workflow, give it a query, and run the step. It returns each result with its title, URL, and description.

Each search is one Search API call. Dify's Brave tool asks for 20 results, so each search is priced as a search of 20 results, as [Search API](https://specstream.ai/docs/search-api.md) lists. [Get your key](https://specstream.ai/workspace/search?route=brave&utm_source=dify&utm_medium=howto) on the Search API screen of your SpecStream workspace. New accounts start with $2 of credit, no card.

## Bing search with the Search API

For Dify users with the **Bing** plugin: open its authorization, paste this into **Bing endpoint**, and put your key in **Bing subscription key**:

`https://api.specstream.ai/v7.0/search`

Paste it with nothing after `search`. The tool adds the query itself.

To check it, add the Bing web search tool to a workflow, give it a query, and run the step. It returns each result with its name, URL, and snippet.

Each search is one Search API call at $5 per 1,000 searches of up to 10 results. It comes out of your balance, with no quote and no approval. [Get your key](https://specstream.ai/workspace/search?route=bing&utm_source=dify&utm_medium=howto) on the Search API screen of your SpecStream workspace. New accounts start with $2 of credit, no card.

## Firecrawl with the Search API and the Extract API

For Dify users with the **Firecrawl** plugin: open its authorization, paste this into **Firecrawl server's Base URL**, and put your key in **Firecrawl API Key**:

`https://api.specstream.ai/firecrawl`

The plugin's search tool then runs on the Search API, and its scrape tool reads pages with the Extract API.

To check it, add the scrape tool to a workflow, give it a URL, and run the step. It returns the page as Markdown.

Each search is one Search API call at $5 per 1,000 searches of up to 10 results. It comes out of your balance, with no quote and no approval. Each page read is one Extract API page at $0.80 per 1,000 pages. [Get your key](https://specstream.ai/workspace/search?route=firecrawl&utm_source=dify&utm_medium=howto) on the Search API screen of your SpecStream workspace. New accounts start with $2 of credit, no card.

## Cost

The plugin is free. SpecStream charges your balance for matching rows, from 5 cents each. **Get List Results** is free. Every rate is on [pricing](https://specstream.ai/pricing.md), and the billing page explains [quotes and charges](https://specstream.ai/docs/billing.md).

## Remove

Uninstall the plugin in Dify. Deleting the key under **Agents & API** stops it working in every tool. Anything those lists found remains in your workspace.

Source: [GitHub (opens in a new tab)](https://github.com/specstream/specstream-tools/tree/main/integrations/dify). More ways to connect SpecStream are in [Connect your tools](https://specstream.ai/docs/integrations.md), and [support@specstream.ai](mailto:support@specstream.ai) answers questions about this plugin.

## More

[SpecStream for Dify](https://specstream.ai/integrations/dify.md) covers what it does in Dify on one page. Every other tool has its guide in [Connect your tools](https://specstream.ai/docs/integrations.md). You see the most a request can cost before it starts, and the matches are paid from your balance. [Billing](https://specstream.ai/docs/billing.md) has the details. For help, email [support@specstream.ai](mailto:support@specstream.ai).
