# Pulling in External JSON/XML Data

### RSS bypassing the FeedOtter UI

This is useful if you want to display some rss content without date/url filters impacting the content.  A popular use-case for this is displaying a list of events.

{% hint style="info" %}
This function expects a valid RSS feed to be returned by the provided URL.
{% endhint %}

```html
<html>
<body>
    [% set events = feed('https://www.feedotter.com/feed') %]
    <h2>Display data directly from an rss feed. Bypass the UI.</h2>
   <ol>
     [% for post in events  %]
    <li>[[post.post_title]]</li>
    [% endfor %]
    </ol>
</body>
</html>
```

### Custom JSON/XML Data

Here is a use case where we pull in the first element of a JSON feed. In this case it will be used as an ad.

```html
<html>
<head>
<!-- Fetch and display an ad unit -->
[% set todayDate = "now"|date("Y-m-d")  %]
<!-- [[todayDate]] -->

<!-- Query for Newsletter Ad Units -->
[% set ad1 = fetchdata('...your endpoint url here....', '{"Date":"' ~ todayDate ~ '"}')[0] %]
[% set ad2 = fetchdata('...your endpoint url here....')[0] %]
</head>
<body>
<!-- Usage in the Email HTML could look like this: -->
[% if ad1 and ad1|length >0 %]
<div><a href="[[ad1.URL]]" target="_blank">
<img src='[[ad1.Creative]]'></a>
</div>
[% else %]
<!-- Optional Fallback ad if none provided by feed -->
<div><a href="[[custom.topFallbackUrl]]">
<img src='[[custom.topFallbackSrc]]'></a>
</div>
[% endif %]
</body>
</html>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.feedotter.com/automated-newsletters/features/multiple-feeds/pulling-in-external-json-xml-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
