# Myfxbook — 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.

> Track global economic events, interest rates, and market schedules by searching the comprehensive economic calendar across countries and dates. Access detailed event histories, historical releases, and market holidays to stay informed on financial market movements and economic indicators.

**Category:** Finance & Markets | **Website:** [myfxbook.com/](https://myfxbook.com/) | **Docs:** [parse.bot/marketplace/8890241a-677d-4e85-9667-b12b2fe0d8df/myfxbook-com-api](https://parse.bot/marketplace/8890241a-677d-4e85-9667-b12b2fe0d8df/myfxbook-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/myfxbook/`
**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 economic calendar

Fetch economic calendar events for a named time window. Returns all scheduled and released events within the chosen period including country, currency, impact level, and consensus/actual values. Periods cover rolling calendar windows relative to today.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `period` | string | No | Time period for calendar events. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/myfxbook/get-economic-calendar \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"period":"<string>"}'
```

### Get economic calendar by country

Fetch economic calendar events filtered by country. Returns all upcoming events for the specified country along with a country description when available.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country_slug` | string | Yes | Country slug identifier (e.g. united-states, united-kingdom, japan, australia, germany, canada). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/myfxbook/get-economic-calendar-by-country \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"country_slug":"<string>"}'
```

### Get economic calendar by date

Fetch economic calendar events for a specific date. Returns the same event structure as get_economic_calendar but scoped to a single calendar day.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | Yes | Date in YYYY-MM-DD format. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/myfxbook/get-economic-calendar-by-date \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>"}'
```

### Get event detail

Fetch detailed information for a specific economic event including its name, impact level, description, and internal event_id (needed for historical data retrieval).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country_slug` | string | Yes | Country slug (e.g. united-states, united-kingdom). |
| `event_slug` | string | Yes | Event slug (e.g. initial-jobless-claims, gdp-growth-rate-qoq). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/myfxbook/get-event-detail \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"country_slug":"<string>","event_slug":"<string>"}'
```

### Get event history

Fetch historical release data for a specific economic event. Provide either event_id directly, or both event_slug and country_slug to look up the event_id automatically. Returns paginated historical records with date, time, previous, consensus, and actual values.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country_slug` | string | No | Country slug (used with event_slug, e.g. united-states). |
| `event_id` | string | No | Event ID from get_event_detail response (can be negative, e.g. -406261830). |
| `event_slug` | string | No | Event slug (used with country_slug to look up event_id, e.g. initial-jobless-claims). |
| `page` | integer | No | Page number for paginated results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/myfxbook/get-event-history \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"country_slug":"<string>","event_id":"<string>","event_slug":"<string>","page":"<integer>"}'
```

### Get holidays calendar

Fetch market and bank holidays for the current week. Returns exchange closure information with date, country, currency, and holiday name.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/myfxbook/get-holidays-calendar \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get interest rates

Fetch central bank interest rates for all tracked countries. Returns the current rate, previous rate, basis-point change, and meeting dates for each central bank.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/myfxbook/get-interest-rates \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get market hours

Fetch forex market session hours for major financial centers (Tokyo, Sydney, New York, London) over a rolling multi-day window. Returns a flat list of sessions with day label, market name, and UTC open/close times, plus a liquidity average.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/myfxbook/get-market-hours \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Search economic events

Search economic calendar events by keyword across event names, countries, and currencies. Searches next week's scheduled events and filters results by the query string (case-insensitive substring match).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword to match against event name, country, or currency (e.g. GDP, inflation, employment, jobless). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/myfxbook/search-economic-events \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```

## Next steps

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