# 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. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-tradestat-commerce-gov-in-api-a9d857eb/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## 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/parse-tradestat-commerce-gov-in-api-a9d857eb/get_available_years \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-tradestat-commerce-gov-in-api-a9d857eb/get_commodity_wise_report \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-tradestat-commerce-gov-in-api-a9d857eb/get_country_wise_report \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-tradestat-commerce-gov-in-api-a9d857eb/get_ftspcc_commodity_country_monthly_report \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-tradestat-commerce-gov-in-api-a9d857eb/get_meidb_report \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-tradestat-commerce-gov-in-api-a9d857eb/search_hs_code \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"description":"<string>","hs_code":"<string>"}'
```
