Getting started
This guide covers how external feeds work and how to use them. Below are two methods to include an external feed in your emails.
Working with External feeds
Create an external feed using the API endpoint in the public API reference.
There are two ways to connect external feeds to email templates:
HTML editor
Add the following code before the HTML body:
myvariable is the variable name used to access feed data, and feedname is the name of the feed you set up via the API endpoint.
Drag and drop editor
For the drag-and-drop editor, switch to developer mode and add the following code at the start of the template:
myvariable is the variable name used to access feed data, and feedname is the name of the feed you set up via the API endpoint.
Accessing external feeds in email
To access data from external feeds, use the code below:
field is any field in the JSON. To access an item, suffix a 0-based index.
Errors in external feeds
Errors can occur at various steps when using an external feed. If an error occurs for a particular contact, that contact is skipped from the email campaign. If a general error affects all contacts, all recipients are skipped, and the reasons appear in the email report.
Common errors include:
- The external feed does not exist or its definition is incorrect in the template.
- External feed placeholders are defined incorrectly in the template.
- An API issue prevents access to the external feed.
How to access external feeds with token authentication
When creating a feed, you can pass a bearer token in the headers for authentication. When the feed is called, the token is included in the headers and the API is called with the information provided. Example header:
Frequently Asked Questions (FAQ)
For a campaign with 50,000 recipients, does Brevo send 50,000 HTTP requests to the external feed API, or one request that’s reused for all emails?
For a global feed:
For n contacts, the server sends n requests to the API unless cache: 'true' is set when creating the feed. When caching is enabled, the feed data is cached for 1 hour (time-based TTL) — the cache does not expire based on the number of emails sent.
For personalized emails with attributes, does Brevo send one request per user or one per campaign?
For a personalized feed:
Since the value differs per recipient, caching does not apply. The server sends one request per recipient even if cache is true.
After any feed change (create, update, or delete), the stale cache may persist for up to 1 hour before the new data is served.
If one request is sent per user, are the attributes passed to the external feed API as POST or GET parameters?
Only GET is supported. Variables are replaced server-side before the request is sent to the API — no variables are passed in the request.
If one request is sent per campaign and personalization is based on attributes mapped to the response JSON, how large can the response JSON be?
There is currently no size limit, but keep the response to required data only — larger responses increase latency.
Examples of Global and Dynamic feeds
Examples of implementing global and personalized external feeds.
Global feed example
This example creates an email campaign about the top 5 trending cryptocurrencies — a global feed where all recipients receive the same information.
The public API for this example is available at this url.
Step 1: Setup Feed
Add a new feed named trendingcryptocoinsfeed.
Step 2a: Connect external feed to the template (New D&D Editor)
Trendingcoins is the variable connected to the trendingcryptocoinsfeed feed.
After setup, Trendingcoins contains all the data accessible in the template.

Step 2b: Connect external feed to the template (HTML Editor)
Trendingcoins is the variable connected to the trendingcryptocoinsfeed feed.
After setup, Trendingcoins contains all the data accessible in the template.

Step 3a: Access feed data in the template (New D&D Editor)
Set up a repeat block in the template to show the first 5 crypto coins in the newsletter.
Display the following data in the newsletter:
- Crypto coin image, name, symbol, and market-cap rank.
Define a For loop using the Repeat block feature. [Read more about repeat block]

Next, add the variables to the template. Since the variable alias Trending is already set up, use it to access feed variables.

The final email shows the top 5 trending crypto coins.

Step 3b: Access feed data in the template (HTML editor)
Set up a repeat block in the template to show the first 5 crypto coins in the newsletter.
Display the following data in the newsletter:
- Crypto coin image, name, symbol, and market-cap rank.
Define a For loop using the Repeat block feature. [Read more about repeat block]
Next, add the variables to the template. Since the variable alias Trending is already set up, use it to access feed variables.
The final email shows the top 5 trending crypto coins.

Personalized feed example
This example creates an email campaign with each contact’s favorite cryptocurrency — a dynamic feed where each recipient receives unique, personalized information.
The public API for this example is available at this url.
Step 1: Setup feed
Add a new feed named favcryptocoinsfeed. Note the contact attribute {{contact.FAVCOIN}} in the URL — it is replaced with the contact’s favorite coin at send time, generating unique data per recipient.
Step 2: Prepare contact recipients
Add a new attribute FAVCOIN and set its value for each recipient of the newsletter.

Step 3a: Connect external feed to the template (New D&D Editor)
Favcoin is the variable connected to the favcryptocoinsfeed feed.
After setup, Favcoin contains all the data accessible in the template.

Step 3b: Connect external feed to the template (HTML Editor)
Favcoin is the variable connected to the favcryptocoinsfeed feed.
After setup, Favcoin contains all the data accessible in the template.

Step 4a: Access feed data in the template (New D&D Editor)
Display the following data from the feed in the newsletter:
- Crypto coin image, name, symbol, market-cap rank, price, description, and homepage link.
Add the variables to the template. Since the variable alias Favcoin is already set up, use it to access feed variables.

The final email shows unique crypto coin information for two different recipients.


Step 4b: Access feed data in the template (HTML Editor)
Display the following data from the feed in the newsletter:
- Crypto coin image, name, symbol, market-cap rank, price, description, and homepage link.
Add the variables to the template. Since the variable alias Favcoin is already set up, use it to access feed variables.
The final email shows unique crypto coin information for two different recipients.

