# Get started with the IaBula API

Create your account, configure an API key and search medications using cURL, JavaScript and Python examples.

Canonical: https://iabula.com/docs/en/getting-started

## 1. Choose your access channel

For direct access, create an account and use the Customer Portal's API key controls. On RapidAPI, open the IaBula listing, select a plan and use the marketplace's native authentication. Do not submit your key to this documentation.

- [Create an account](https://iabula.com/signup)
- [Open your account](https://iabula.com/account)
- [RapidAPI integration](https://iabula.com/docs/en/rapidapi)

## 2. Configure your environment

Set IABULA_API_BASE to https://api.iabula.com for the published service. Configure IABULA_API_KEY in your server's secret manager or environment. The examples assume you already have a valid key; they do not include credentials.

```bash
export IABULA_API_BASE="https://api.iabula.com"
```

> A portal session does not automatically authenticate /v1 calls. Direct requests need X-API-Key. Keep secret keys out of public source code and frontend bundles.

## 3. Make your first search

```bash
curl --fail-with-body --get "$IABULA_API_BASE/v1/medications/search" \
  --header "X-API-Key: $IABULA_API_KEY" \
  --data-urlencode 'q=dipirona' \
  --data-urlencode 'limit=20'
```

```javascript
// Run on your server. Keep the API key out of browser bundles.
const url = new URL("/v1/medications/search", process.env.IABULA_API_BASE);
url.search = new URLSearchParams({ q: "dipirona", limit: "20" });
const response = await fetch(url, {
  headers: { "X-API-Key": process.env.IABULA_API_KEY },
});
const page = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${page.code}`);
console.log(page.data, page.next_cursor);
```

```python
import json
import os
from urllib.parse import urlencode
from urllib.request import Request, urlopen

base = os.environ["IABULA_API_BASE"].rstrip("/")
query = urlencode({"q": "dipirona", "limit": 20})
request = Request(
    f"{base}/v1/medications/search?{query}",
    headers={"X-API-Key": os.environ["IABULA_API_KEY"]},
)
with urlopen(request, timeout=15) as response:
    page = json.load(response)
print(page["data"], page["next_cursor"])
```

The response is a page with data and next_cursor. data contains MedicationSummary records; a search without matches may return an empty list. Continue by passing next_cursor as cursor with the original filters.

## 4. Inspect and integrate

In the Playground, sign in with an active, email-verified account. Requests use the session and linked account access with the plan's limits; the default mode does not require pasting a key. Outside the Playground, use X-API-Key for direct integrations or native RapidAPI credentials.

- [Search parameters](https://iabula.com/docs/en/medications)
- [Playground](https://iabula.com/playground)
- [Interactive Swagger](https://iabula.com/docs/swagger)
- [Errors and retries](https://iabula.com/docs/en/errors)

Before integrating, decide how to handle empty lists, null fields, cursors and 429 responses. Bound your retries and honor Retry-After. Read provenance before assigning regulatory meaning to a field.

## Resources

- [OpenAPI JSON](https://iabula.com/openapi.json)
- [Swagger](https://iabula.com/docs/swagger)
- [Documentation index](https://iabula.com/llms.txt)
