# RFI — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Check real-time train schedules and station information across Italy's railway network, search for stations, and get live alerts about delays and service disruptions. Monitor train circulation status and access detailed station mappings to plan your journeys efficiently.

**Category:** Travel | **Website:** [rfi.it/](https://rfi.it/) | **Docs:** [parse.bot/marketplace/17272d1c-231b-4695-ac5c-26d3452668ef/rfi-it-api](https://parse.bot/marketplace/17272d1c-231b-4695-ac5c-26d3452668ef/rfi-it-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-rfi-it-api-17272d1c/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_infomobilita_alerts

Retrieve current railway circulation alerts and disruptions from the RFI Infomobilità ticker on the homepage. Returns line-level status messages about suspensions, delays, technical issues, and restored service. Empty array indicates no current disruptions.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-rfi-it-api-17272d1c/get_infomobilita_alerts \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_live_monitor

Retrieve the real-time departures or arrivals board for a specific Italian railway station. Either place_id or station_name must be provided. If station_name is given, it is resolved to a place_id internally via the station mappings. Returns scheduled trains with carrier, category, number, destination/origin, time, delay, platform, and intermediate stops.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `place_id` | string | No | Numeric place ID of the station (from get_station_mappings endpoint) |
| `station_name` | string | No | Full uppercase name of the station (e.g. 'ROMA TERMINI'). Resolved to place_id internally. |
| `type` | string | No | Board type: 'departures' or 'arrivals' |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-rfi-it-api-17272d1c/get_live_monitor \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"place_id":"<string>","station_name":"<string>","type":"<string>"}'
```

### get_station_details

Retrieve detailed information for a specific station including available services (bars, parking, bike facilities) and accessibility features (PRM assistance, accessible platforms). The station is identified by its URL slug.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `station_slug` | string | Yes | URL slug of the station (e.g. 'roma-termini', 'abbiategrasso', 'milano-centrale') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-rfi-it-api-17272d1c/get_station_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"station_slug":"<string>"}'
```

### get_station_mappings

Retrieve the complete station name to placeId mapping used by the live monitor. Returns all Italian railway station names mapped to their numeric place IDs.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-rfi-it-api-17272d1c/get_station_mappings \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_stations

Search and list Italian railway stations from the RFI GIS service. Supports filtering by name keyword, region, province, and municipality. Results ordered alphabetically by name.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of results to return |
| `municipality` | string | No | Municipality name filter (e.g. 'Roma', 'Milano') |
| `province` | string | No | Province name filter (e.g. 'Roma', 'Milano') |
| `query` | string | No | Station name keyword (case-insensitive partial match) |
| `region` | string | No | Region name filter (e.g. 'Lombardia', 'Lazio') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-rfi-it-api-17272d1c/search_stations \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","municipality":"<string>","province":"<string>","query":"<string>","region":"<string>"}'
```
