# Integrating with third party services

There are two main ways of using third party services with Midio. If the service has a corresponding package in the [package manager](/midio-docs/package-manager.md), then that is a good place to go. If not, then it is usually not that diffcult to make the integration yourself using [Http.Fetch](/midio-docs/built-in-nodes/http.md#fetch).

#### Integrating using `Http.Fetch`

As long as the service you're trying to integrate with has a REST api available, then it should be pretty simple to use it with Midio.

Lets make an integration with <https://pokeapi.co/> (which requires no API key) as a simple example.

{% hint style="warning" %}
If the service you're integrating with requires an API key, check out the [docs on secrets here](/midio-docs/guides/secrets-and-environment-variables.md).
{% endhint %}

<figure><img src="/files/dm0UZFZlaCn5Y9GFb6C6" alt="" width="563"><figcaption></figcaption></figure>

You can make a request to this api by adding an `Http Fetch` node, and pasting the base url into the url input like we do above.

The various API endpoints can be reached by modifying the url, but lets make some nodes that wrap the API in a nicer way.

### Making a nicer wrapper

First, lets convert this node into a reusable function; right click on the node, and select 'Convert to function'. Give it a name, like `PokeAPI Base`.

<figure><img src="/files/jKt5HhSBevMwxNl9tETm" alt="" width="563"><figcaption></figcaption></figure>

This will give us a node without any inputs and output. Click it press the 'goto definition' button in the node toolbar, or 'g' on the keyboard.

<figure><img src="/files/zMi6qqdfvWat5Euc6Wqg" alt="" width="375"><figcaption></figcaption></figure>

Adding inputs and outputs is super simple. Simply start creating an arrow by clicking a socket on the `Fetch` node, then control/cmd-click anywhere on the canvas to automatically create an input/output.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdFpuRAnTVYgmlCXLLou%2Fuploads%2FnZ2xXg78Fin7XZaAgIuI%2Fadd-inputs-wrapper-example.mp4?alt=media&token=94264f4d-242f-481f-bab6-edab6058df9c>" %}

This function can now serve as a base for us to make custom functions for the various endpoints of PokeAPI.

As an example, here is a wrapper for the "pokemon" endpoint.

<figure><img src="/files/yAZruy1Dkl3TprDg6S77" alt=""><figcaption></figcaption></figure>

Which can then be used like so:<br>

<figure><img src="/files/7PBVKtuzfMdY9EiJPLKu" alt="" width="563"><figcaption></figcaption></figure>


---

# 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.midio.com/midio-docs/integrating-with-third-party-services.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.
