Skip to main content

API Request Node

The API Request Node sends a GET or POST request to any HTTP or HTTPS address and passes on the reply. Use it to get data from APIs, such as PubMed, ClinicalTrials.gov, openFDA or a weather service, as the starting point of a workflow, or anywhere data comes in from outside.

The request goes out from the Agentic Signal backend, not the browser, so APIs that don't allow browser requests (CORS) work too.

API Request Node

Configuration​

The address to call, with http:// or https:// (e.g., https://api.fda.gov/drug/label.json?limit=1). It can hold saved credentials as {{name}}: see Credentials.

API Request Node settings


Errors​

When the API answers with an error status, the node shows the status and the start of the reply, where APIs explain what went wrong. For example, openFDA answers a search with no results like this:

Request failed: HTTP 404 Not Found: {"error":{"code":"NOT_FOUND","message":"No matches found!"}}

For an API that answers "nothing found" this way, as openFDA and PubChem do, turn on A 404 (not found) is an empty reply in the node's settings: the node then passes on an empty reply (null; no rows for csv, empty text for text), so the next steps can say nothing was found, and any other error status still stops it. The switch is the node's own setting, also with Provided by Upstream. A wrong address that the server answers with a 404 then reads as nothing found too, so try a new URL with the switch off first.

When an API says it's busy or rate limited (status 429 or 503), the node waits and asks again, at most twice: as long as the API asks, or 1 and then 2 seconds. If the API asks for more than 10 seconds, the node stops at once and the error says how long to wait, rather than ask again too early. A POST is asked again after a 429 only: after a 503 the server may already have done what it asked. A request gives up when the server hasn't started answering within 30 seconds, or when the whole request takes more than 5 minutes, retries, redirects and reading the reply included.

Local Addresses​

An address on your own computer or network is called only if you allow it. That covers localhost, IP addresses such as 192.168.1.10, and names that lead to such an address, such as nas.lan. Otherwise the node stops with:

Request failed: http://localhost:11434 is a local address, and calls to it are off: turn on "Allow local address" in this node's settings.

Allow local address switch

Turn on Allow local address in the node's settings to allow it. The permission is for that address (scheme, host and port), so it covers every API Request node that calls it, in every workflow. It is kept in this app only, never in a workflow file: a workflow someone sends you can't bring it along, so their local addresses stay off until you turn them on. Turning the switch off takes the permission back.

The switch shows when the node's URL is plainly local (localhost, an IP address on your network, a name without a dot, or one ending in .local, .lan, .internal or .home.arpa), after a request was stopped at a local address, and for an address you allowed, so you can turn it off again. A name like nas.example.com can lead to a local address too: the first request tells, and the switch then appears.

A public address that redirects to a local one is stopped the same way, naming the local address. With Provided by Upstream, the switch is for the address the last request went to. When the URL is a saved credential ({{myHomeApi}}), the message and the switch name it by its placeholder, not the address it holds.

Credentials​

A key saved in Settings → Credentials can go into the URL, a header value or the body as {{name}}:

https://api.example.com/data?apikey={{myApiKey}}
  • The value is filled in only to send the request, exactly as it is saved, with nothing escaped. In a URL, if it holds characters such as & or spaces, save it URL-encoded. In a JSON body, a value with a quote, a backslash or a line break would break the JSON: save it escaped as JSON. A whole URL saved as a credential works too: {{myPrivateFeedUrl}}.
  • To send double braces as text, such as an email template's {{first_name}}, write \{{first_name}}: the backslash is taken out and the rest goes as written. A backslash right before {{ always reads this way, so a credential can't follow a backslash directly.
  • The node, the workflow file and the data passed between nodes keep {{myApiKey}}. Errors show the placeholder, not the value.
  • If the name isn't saved, or the vault is locked, the node stops with an error that says which.
  • If an API redirects to another address, only the Accept and Content-Type headers go along, so a key in a header isn't sent elsewhere. A redirect that would send the body there too (status 307 or 308) isn't followed: the node stops and names the other address.
caution

With Provided by Upstream, whatever builds the request decides which key is sent and to which site: an LLM, a fetched page or an outside app could point {{name}} somewhere else. Use it only with sources you trust, and check workflows from others before running them.

Example Usage​

For example usage, see the Timeseries Chart workflow, which demonstrates fetching API data and visualizing it.

Common Use Cases​

  1. API Data Fetching: Retrieve data from public or private APIs.
  2. Search APIs: POST a query, such as a GraphQL one, and pass the results on.
  3. Workflow Trigger: Start a workflow with external data.
  4. Local Services: Call a service running on your computer or network, once you allow its address.

Best Practices​

  • Use the right data type: match it to what the API returns.
  • Secure keys: save API keys in Settings → Credentials and write {{name}} in the URL, a header or the body, so they stay out of workflow files.
  • Keep replies small: many APIs can limit the fields or rows they return. Large replies slow down the nodes after this one and may not fit an LLM's context.

Troubleshooting​

Common Issues​

  • Invalid input: check that the URL starts with http:// or https://, and that a data type is chosen.
  • Unexpected data format: the error quotes the start of the reply. Pick the data type that matches it.
  • A local address is refused: turn on Allow local address in the node's settings (see Local Addresses).
  • Network errors: check your internet connection and that the address is reachable from the computer the backend runs on.
  • Couldn't look up a name: the backend couldn't ask DNS whether the address is local (offline, or a network where only a proxy resolves names), so it doesn't call it.