# Tradestat Commerce — 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.

> Analyze India's trade patterns by searching export-import data across commodities, countries, and regions using HS codes and historical records. Track bilateral trade flows and commodity-wise statistics to understand market trends and make informed trade decisions.

**Category:** Government & Public Data | **Website:** [tradestat.commerce.gov.in/](https://tradestat.commerce.gov.in/) | **Docs:** [parse.bot/marketplace/a9d857eb-f8c3-4734-9062-aa65f583d5c7/tradestat-commerce-gov-in-api](https://parse.bot/marketplace/a9d857eb-f8c3-4734-9062-aa65f583d5c7/tradestat-commerce-gov-in-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/tradestat-commerce/`
**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 available years

Get list of available financial years for the EIDB reports. Returns year values and display text. No parameters required.

**Estimated cost:** Metered

_No parameters required._

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

### Get commodity wise report

Fetch commodity-wise trade data for a given financial year. Returns a table of commodities with HS codes, trade values for two consecutive years, percentage share, and growth rate. Paginates as a single page containing all matching rows at the requested HS-code digit level. When hs_code is provided, filters results to the single row matching that code.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `commodity_level` | string | No | HS code digit level. |
| `hs_code` | string | No | Optional HS code to filter results. When provided, only the row with a matching HSCode is returned. Should match the digit level specified by commodity_level (e.g., an 8-digit code when commodity_level is '8'). |
| `trade_type` | string | No | Type of trade. |
| `values_in` | string | No | Currency or unit for values. |
| `year` | string | No | Financial year starting year (e.g., '2024' for 2024-2025). Available values: 2018 through 2025. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/tradestat-commerce/get-commodity-wise-report \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"commodity_level":"<string>","hs_code":"<string>","trade_type":"<string>","values_in":"<string>","year":"<string>"}'
```

### Get country wise report

Fetch trade summary grouped by country for a given financial year. Returns country-level trade data with values for two years, percentage share, and growth. Supports exports and imports views. When hs_code is provided, returns country-level data for that specific commodity (using the commodity-wise-all-countries report).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country` | string | No | Country code or 'all' for all countries. |
| `hs_code` | string | No | Optional HS code to filter results. When provided, returns country-level trade data for that specific commodity across all countries. |
| `trade_type` | string | No | Type of trade. |
| `values_in` | string | No | Currency for values. |
| `year` | string | No | Financial year starting year (e.g., '2024' for 2024-2025). Available values: 2018 through 2025. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/tradestat-commerce/get-country-wise-report \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"country":"<string>","hs_code":"<string>","trade_type":"<string>","values_in":"<string>","year":"<string>"}'
```

### Get ftspcc commodity country monthly report

Fetch FTSPCC Commodity x Country wise (Monthly) report from India's Foreign Trade Statistics. Returns monthly trade values (in both Rs. Crores and US$ Millions) for a specific commodity-country pair over a date range. Each row represents one month's trade data. The report covers data from January 2010 onwards.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `commodity` | string | Yes | Principal commodity code (e.g., 'A1' for TEA, 'H8' for DRUG FORMULATIONS, BIOLOGICALS). Use the site's predefined commodity codes. |
| `country` | string | Yes | Country numeric code (e.g., '423' for U S A, '421' for U K, '419' for U ARAB EMTS). Use the site's predefined country codes. |
| `from_month` | string | No | Start month number (1-12). |
| `from_year` | string | No | Start year (e.g., '2025'). Available range: 2010 through 2026. |
| `to_month` | string | No | End month number (1-12). |
| `to_year` | string | No | End year (e.g., '2025'). Available range: 2010 through 2026. |
| `trade_type` | string | No | Type of trade. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/tradestat-commerce/get-commodity-country-monthly-report \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"commodity":"<string>","country":"<string>","from_month":"<string>","from_year":"<string>","to_month":"<string>","to_year":"<string>","trade_type":"<string>"}'
```

### Get meidb report

Fetch Monthly Export Import Data Bank (MEIDB) report. Returns commodity-wise monthly trade data comparing a specific month across two years, plus cumulative totals for a period. Column headers are dynamic based on selected month and year. When hs_code is provided, filters results to the single row matching that code.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `commodity_level` | string | No | HS code digit level. |
| `hs_code` | string | No | Optional HS code to filter results. When provided, only the row with a matching HS Code is returned. Should match the digit level specified by commodity_level. |
| `month` | string | No | Month number (1-12). |
| `trade_type` | string | No | Type of trade. |
| `values_in` | string | No | Currency or unit. |
| `year` | string | No | Year for the report. Available values: 2018 through 2025. |
| `year_type` | string | No | Year type for the report. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/tradestat-commerce/get-meidb-report \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"commodity_level":"<string>","hs_code":"<string>","month":"<string>","trade_type":"<string>","values_in":"<string>","year":"<string>","year_type":"<string>"}'
```

### Search hs code

Search for HS codes and their descriptions by partial code or keyword. Returns matching HS codes with unit information. At least one of hs_code or description should be provided for meaningful results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `description` | string | No | Keyword search in commodity description (e.g., 'rice'). |
| `hs_code` | string | No | Partial HS code to search (e.g., '10' to find all codes starting with 10). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/tradestat-commerce/search-hs-code \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"description":"<string>","hs_code":"<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.