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

# Databar

Call SpecStream from a Databar table with your own SpecStream API key, through Databar's custom API connector. Ask the Search API one question per row, or ask Deep Search for a list and read its rows back.

[SpecStream for DatabarOutreach & sales](https://specstream.ai/integrations/databar.md)

## What you need

-   A Databar plan that includes custom APIs.
-   A SpecStream account. New accounts get $10 of credit on sign-up, no card. [Create one](https://specstream.ai/signup?utm_source=databar).
-   A SpecStream API key, made in step 1.

1.  1

    ## 1. Create an API key

    In SpecStream, open [Agents & API](https://specstream.ai/workspace/agents?tab=keys&utm_source=databar), choose **API keys**, then **Create API key**, and name the key Databar.

    The Search API needs **Authorize paid work**. Deep Search also needs **Read saved requests**, **Create and edit requests**, **Prepare work and follow-ups**, and **Read results and their sources**. Under **Authorize paid work**, give the key a **Total spending limit**. Before the key can start a run, set your account's own spending limit in **Settings**, under **Usage and billing**.

    The key is shown once, so copy it before you close the dialog.

2.  2

    ## 2. Connect the Search API

    In Databar, open **Integrations** from your workspace home and click **Connect a custom API**. Fill it in as below: for authentication, send the header `Authorization` with `Bearer` and your key, and add one request parameter, `q`, for the question. Click **Save**.

    Custom API

    ```text
    Method: GET
    URL: https://api.specstream.ai/v1/web-search
    Header: Authorization = Bearer YOUR_SPECSTREAM_KEY
    Parameter: q
    ```

3.  3

    ## 3. Ask one question per row

    In a table, add a column that holds the question for each row, such as `Who is the chief executive of Datadog?`. In the Enrich sidebar, choose **Add or use your own REST API**, pick the search connector, and map the question column to `q`. Click **Add Columns**, then **Run**.

    `data.answer.value` is the answer, `data.answer.page` is the page it was read from, and `data.answer.seen_at` is when it was read. When no result prints an answer, `data.answer` is empty and `data.sources` lists the results read.

    Each search is $5 per 1,000 searches of up to 10 results, with no quote and no approval.

4.  4

    ## 4. Connect Deep Search

    Deep Search finds every match for a request. Connect a second custom API with the method POST, the URL `https://api.specstream.ai/v1/capacity/requests`, and the same `Authorization` header. Add a parameter `Content-Type` with the value `application/json`, which takes the place of Databar's default.

    Under Body parameters, click **Use a custom template** and paste the template below. Databar puts each row's value in place of each name between dollar signs. `requested_units` is how many results to find, and `confirm_max_cents` is the most the request may cost, in cents: here 25 results for at most $5. Click **Save**.

    Custom template

    ```json
    {
      "q": "$request$",
      "requested_units": 25,
      "confirm_max_cents": 500,
      "idempotency_key": "$key$"
    }
    ```

5.  5

    ## 5. Start a request and see its price

    In a table, add a column with the request, such as `Cybersecurity software companies in Germany with 50 to 200 employees, with their website and headquarters city`, and a column with a key of 8 to 128 characters, new for each request. Add the Deep Search connector, map the columns to `request` and `key`, and run it.

    SpecStream answers at once with `data.state` set to `reading`. It then reads the request and prices it, and starts the run only when the price is at or below `confirm_max_cents`. Above it, nothing runs.

    To see the price before anything runs, set `confirm_max_cents` to 1 in the template. The state is then `above_maximum`, and the next step shows the price. To approve that price, put it in the template and start the row again with a new key.

6.  6

    ## 6. Read the rows

    Connect a third custom API with the method GET, the same `Authorization` header, and the URL below, with the request's key in place of `YOUR_REQUEST_KEY`. Reading it costs nothing.

    `data.state` says where the request stands, `data.read_back` is how SpecStream read it, and `data.maximum_cents` is the price. Run it again until `data.done` is true. The rows are then in `data.flat_rows`, one item per result, up to 100 a call. For more, add the parameter `cursor` with the value of `data.next_cursor`.

    The same rows open in your SpecStream workspace at `list_link`, where **Export** downloads them as a CSV.

    URL

    ```text
    https://api.specstream.ai/v1/capacity/requests/YOUR_REQUEST_KEY/rows
    ```

## What arrives

Each item of `data.flat_rows` is one result as flat fields.

Source URL and read time on every value.

-   `id`, `position`, and `list_link`, which opens the list in your SpecStream workspace.
-   One field per column, named the way the list names it.
-   `<field>_source` beside each field: the page that value was read from.
-   `source_url` and `checked_at`: the page of the fact that put the result in the list, and when it was read.
-   `rows` holds each result in full, with every value's page and read time.

## What the state says

| \`state\` | What it means | What to do |
| --- | --- | --- |
| `reading` | SpecStream is reading the request and pricing it. | Read it again in a few seconds. |
| `started` | The run started. `status` shows where it is. | Read the rows again until `data.done` is true. |
| `needs_edit` | SpecStream needs a clearer request. `read_back` shows how it read it. | Add the place or what every result must meet, then start it again with a new key. |
| `above_maximum` | The price is above your maximum, and nothing ran. `maximum_cents` is the price. | Raise the maximum or ask for fewer results, then start it again with a new key. |
| `failed` | The run did not start. `message` says why, such as the key's spending limit. | Fix what `message` names and start it again with the same key. |

## Cost

Searches and rows are paid to SpecStream from your SpecStream balance. Reading a request, pricing it, and reading its rows cost nothing. A search is $5 per 1,000 searches of up to 10 results. Each matching row costs 5¢, 15¢ or $1, depending on how much the row needs, plus 5¢ for a person's email and 15¢ for a phone. A run never costs more than the maximum you set, and a run that finds nothing costs nothing. Databar bills for its own plan. [Balance, quotes, and billing](https://specstream.ai/docs/billing.md) has the details.

## Disconnect

Remove the SpecStream connectors from your Databar workspace. To end access, revoke the key under **API keys** in **Agents & API**. Rows already in Databar stay there. Questions go to [support@specstream.ai](mailto:support@specstream.ai).

## More

[SpecStream for Databar](https://specstream.ai/integrations/databar.md) covers what it does in Databar 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).
