Featured

Batch API Requests with SaltingIO: Call Multiple Endpoints at Once

You're pulling data from multiple APIs at once. SaltingIO Batch Requests let you call them all in one POST, transform the responses, and keep every key hidden.

SaltingIO Team March 17, 2026 5 min read Tutorials
JavaScriptAPISecurityFrontendSaltingIOWebDevTutorials
Batch API Requests with SaltingIO: Call Multiple Endpoints at Once

Batch API Requests with SaltingIO: Call Multiple Endpoints at Once

You're building a dashboard that needs stock prices, weather data, and user notifications — all at once. That's three separate fetch calls, three round trips, and three API keys sitting exposed in your frontend code.

There's a better way.


The Problem: Multiple APIs, Multiple Headaches

Every additional network request adds latency. When your app depends on data from three different providers, you're either chaining requests one after another or juggling Promise.all with messy error handling.

And every one of those APIs needs a secret key — which means each key is one View Source away from being stolen.


The Myth: "Batch Requests Require a Custom Backend"

The traditional solution is a server-side orchestrator: a Node.js or Python endpoint that fans out requests to multiple providers, collects the responses, and returns a unified payload to your frontend.

It works. But it's:

  • Another service to deploy and maintain
  • An extra network hop that adds latency
  • Overkill for most frontend use cases

SaltingIO handles all of this with a single POST request from your browser.


Step-by-Step: Using SaltingIO Batch Requests

Here's how to call multiple endpoints at once, transform the responses, and keep every API key hidden — from a single frontend call.

Step 1: Create a Bridge for Each Endpoint

Each external API you want to batch needs its own Bridge record in your SaltingIO dashboard.

Go to the Secrets page and click Add Secret, then set the type to Bridge. Configure:

  • URL: The upstream API endpoint, with your key already embedded
  • Allowed Origins: Your app's domain, for CORS protection
  • Allowed Methods: GET or POST depending on the provider

Repeat this for each API you want to call. Each bridge gets its own UUID.

For dynamic data — like weather for a specific city or a stock quote for a specific ticker — use template variables in your stored URL:

https://api.weatherapi.com/v1/current.json?key=YOUR_SECRET_KEY&q={{city}}

When you pass params: { city: "London" } in your batch request, SaltingIO substitutes {{city}} before calling the provider. Your key never leaves the server.


Step 2: Build Your Select Strings in the Playground

Before writing any frontend code, test your bridges in the Playground tab of your SaltingIO dashboard.

Open the Transformation tab and click response fields to build a select string. This reshapes what comes back — so you only receive the data your UI actually needs.

For example, a WeatherAPI response is deeply nested. Your select string can flatten it:

{temp:current.temp_c,city:location.name,condition:current.condition.text}

SaltingIO applies this server-side before anything reaches your browser. No extra parsing or post-processing needed in your app.


Step 3: Send the Batch Request

With your bridges configured and select strings ready, here's what changes in your code.

Before (Insecure — Three Exposed Keys)

// Three separate calls, three exposed keys
const weather = await fetch(
  "https://api.weatherapi.com/v1/current.json?key=SECRET1&q=London"
);
const stock = await fetch(
  "https://financialmodelingprep.com/api/v3/quote/AAPL?apikey=SECRET2"
);
const news = await fetch(
  "https://newsapi.org/v2/top-headlines?apiKey=SECRET3&q=technology"
);

After (Secure — One Request, All Keys Hidden)

const response = await fetch("https://api.salting.io/batch", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    requests: [
      {
        uuid: "your-weather-bridge-uuid",
        params: { city: "London" },
        select: "{temp:current.temp_c,city:location.name}"
      },
      {
        uuid: "your-stock-bridge-uuid",
        params: { ticker: "AAPL" },
        select: "{symbol:0.symbol,price:0.price}"
      },
      {
        uuid: "your-news-bridge-uuid",
        select: "articles.0"
      }
    ]
  })
});

const [weatherData, stockData, newsData] = await response.json();

One request. Three APIs. Zero exposed keys. The response array maps 1:1 to your requests input — position 0 is weather, position 1 is stock, position 2 is news.


How It Works Under the Hood

When SaltingIO receives your batch request:

1. UUID Lookup

Each uuid resolves to its stored Bridge configuration — the upstream URL, credentials, and headers stored securely on SaltingIO's servers.

2. Template Variable Substitution

If you passed params, SaltingIO substitutes them into the stored URL before the upstream call. {{city}} becomes London. Your API key is already embedded server-side.

3. Parallel Upstream Calls

SaltingIO fans out all requests to their respective providers in parallel — on its infrastructure, not yours.

4. Response Transformation

If you included a select string, SaltingIO reshapes each response using GJSON-style paths before the data reaches your browser.

5. Ordered Array Response

The final response is an array in the exact same order as your input. Destructure it directly — no matching or sorting required.


Pro Tip: Test Your Full Batch in the Playground

Before wiring up your frontend, validate your entire batch configuration in the Playground tab.

Switch to Batch mode, add your bridge UUIDs, configure params and select strings for each, and fire the request. You'll see the complete response array and can iterate on transformations visually — without touching any code.

This is especially useful when combining APIs with very different response shapes. Build the select strings in the Playground, copy them, and paste them directly into your frontend.


Conclusion

Batch requests with SaltingIO let you:

  • Call multiple third-party APIs from a single frontend request — no backend orchestrator needed
  • Keep every API key hidden — credentials never reach the browser
  • Transform and flatten responses with select strings — no extra parsing in your app
  • Use template variables to pass dynamic parameters — one bridge, unlimited inputs

Stop juggling multiple fetch calls and scattered secret keys. One batch request handles it all.


Secure your first API key for free on SaltingIO →