> For the complete documentation index, see [llms.txt](https://docs.feedotter.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.feedotter.com/newsletters/content-sources/json-xml-api.md).

# JSON / XML API

Connect an XML or JSON feed to Feedotter and map its data to the fields used in your curated newsletters.

### Add an XML or JSON Feed

Navigate to **Content > Content Sources** from the left sidebar.

Click **Add Content Source** in the upper-right corner.

Under the **Details** tab:

1. Enter a **Name** for your content source.
2. Select **XML** or **JSON** as the **Source Type**.
3. Select any **Groups** you'd like the source to appear in.
4. Enter the **XML URL** or **JSON URL** for your feed.
5. Click **Load Feed**.

<div data-with-frame="true"><figure><img src="https://2086102864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIdHBGk8cqznUpEqm5g1U%2Fuploads%2FhaeTVWIBAZgKV9Lzp0Tu%2Fimage.png?alt=media&amp;token=9b1dd6e1-a1ee-4a40-8212-5834da93d153" alt=""><figcaption></figcaption></figure></div>

Once the feed has loaded, navigate to the **Fields** tab to map your content.

### Map Your Content Fields

Under the **Fields** tab, select the appropriate **Data Structure** for the items in your feed.

Then, use **Field Mapping** to tell Feedotter which data from your feed should be used for each content field.

Map the appropriate element path for:

* **Title**
* **Description**
* **URL**
* **Date**
* **Image URL**

You can also select the appropriate **Type** for each mapped field.

<div data-with-frame="true"><figure><img src="https://2086102864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIdHBGk8cqznUpEqm5g1U%2Fuploads%2FYZERZGE2U0X9szGkmvyX%2Fimage.png?alt=media&amp;token=452aefdd-2c67-44e8-bd30-e07b9ddb96ba" alt=""><figcaption></figcaption></figure></div>

### Add Custom Data Mapping

If your feed contains additional information you'd like to use in Feedotter, click **Add new custom data mapping**.

This allows you to map additional fields from your XML or JSON data beyond the standard content fields.

<div data-with-frame="true"><figure><img src="https://2086102864-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIdHBGk8cqznUpEqm5g1U%2Fuploads%2FjSXQuFOFC88v0EktClO7%2Fimage.png?alt=media&amp;token=bcbf52bf-36ac-4cfa-9ab8-587beeec4cef" alt=""><figcaption></figcaption></figure></div>

Read more about this here:&#x20;

{% content-ref url="/pages/NGa7jlmlKBwt7ESZZ7Gv" %}
[Custom Data Fields](/newsletters/content-sources/json-xml-api/custom-data-fields.md)
{% endcontent-ref %}

### Add a Search Parameter

If your XML or JSON source supports search, you can add a **Search Parameter** to allow users to search the source directly from Feedotter.

Under **Search parameter**, enter the parameter name your API uses for search, such as `query` or `q`.

For example, if your API uses:

`?query=YOURSEARCHTERM`

enter **query** as the Search Parameter.

Once configured, your users can now:

* Select the content source within your curated newsletter
* Type any keyword into the **search box**
* Instantly view filtered results from the JSON feed.

If your source does not support search, you can leave this field blank.

### Preview Your Content

Once your fields are mapped, select the **Preview** tab and click **Generate Preview**.

Review the sample content to make sure Feedotter is pulling the correct **title, description, URL, date, image,** and any custom data you've mapped.

Once everything looks correct, click **Add Source**.

Your XML or JSON feed will now be available as a Content Source when adding content to a curated newsletter.
