# RFI — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/rfi/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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.beta.paywithlocus.com/api/wrapped/credits/rfi/get-infomobilita-alerts \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/rfi/get-live-monitor \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/rfi/get-station-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/rfi/get-station-mappings \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/rfi/search-stations \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","municipality":"<string>","province":"<string>","query":"<string>","region":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.