> For the complete documentation index, see [llms.txt](https://modfin.gitbook.io/mfn-integration-guide/-MbDBLBpI3LuyvwyWLVw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://modfin.gitbook.io/mfn-integration-guide/-MbDBLBpI3LuyvwyWLVw/integration-methods/on-demand.md).

# On-Demand API

## Description

* Each request to you site fetches live data directly from the MFN API
* Can be used from backend or frontend

## Getting Started

### News feed

Start by studying the Feed API and corresponding News Item model. The feed should be simple to be consume with any HTTP client and is available in both JSON or XML.&#x20;

{% content-ref url="/pages/-MbCyvnEIJCQ6uwz9Bcl" %}
[Feed](/mfn-integration-guide/-MbDBLBpI3LuyvwyWLVw/api/feed.md)
{% endcontent-ref %}

#### Typical filtering setups

Most of the time the website should be divided into different parts / menus for different categories of press releases. Typically at least the user should be able to distinguish between Regulatory releases and other press releases. If the customer will use MFN for PR many times it will also be displayed in a separate feed.

| Description                                                                                                                                                                                                                           | Query params                                      |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| All releases ([IR & PR](/mfn-integration-guide/-MbDBLBpI3LuyvwyWLVw/overview/getting-started.md#ir-pr))                                                                                                                               | `<none>`                                          |
| Press releases ([IR](/mfn-integration-guide/-MbDBLBpI3LuyvwyWLVw/overview/getting-started.md#investor-relations-ir))                                                                                                                  | `type=ir`                                         |
| Regulatory                                                                                                                                                                                                                            | `tag=:regulatory`                                 |
| Reports                                                                                                                                                                                                                               | `tag=sub:report`                                  |
| News ([PR](/mfn-integration-guide/-MbDBLBpI3LuyvwyWLVw/overview/getting-started.md#public-relations-pr))                                                                                                                              | `type=pr`                                         |
| Other News ([PR](/mfn-integration-guide/-MbDBLBpI3LuyvwyWLVw/overview/getting-started.md#public-relations-pr) and Non regulatory [IR](/mfn-integration-guide/-MbDBLBpI3LuyvwyWLVw/overview/getting-started.md#investor-relations-ir)) | `filter=(not(.properties.tags@>[":regulatory"]))` |

### News item

To fetch and display a single press release from the API you can use either use the query param `news-slug` ([.content.slug](/mfn-integration-guide/-MbDBLBpI3LuyvwyWLVw/api/model.md#model-2)) or [`news-id`](/mfn-integration-guide/-MbDBLBpI3LuyvwyWLVw/api/model.md#model) in combination with the base feed url.&#x20;

{% tabs %}
{% tab title="Slug" %}

```
https://feed.mfn.se/v1/feed/<feed_id>[.json/.xml]?news-slug=<slug>
```

{% endtab %}

{% tab title="News Id" %}

```
https://feed.mfn.se/v1/feed/<feed_id>[.json/.xml]?news-id=<news_id>
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If .json or .xml is left out, it will return JSON by default
{% endhint %}

#### Typical Page Layout

| Part         | JSON model path         |
| ------------ | ----------------------- |
| Title        | `.content.title`        |
| Publish Date | `.content.publish_date` |
| Tags (\*)    | `.properties.tags`      |
| Text Body    | `.content.html`         |
| Attachments  | `.content.attachments`  |

(\*) Press releases can contain many [tags](/mfn-integration-guide/-MbDBLBpI3LuyvwyWLVw/api/model/tags.md#subject-namespace-sub), but typically a select few would be displayed as actual visible tags. Most commonly `:regulatory` as Regulatory / Regulatorisk according to site language.
