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

> Access comprehensive agricultural data including crop production estimates, minimum support prices (MSP), crop yield trends, and planting calendars for both domestic and international markets. Search through agricultural reports and statistics to track commodity prices, production forecasts, and seasonal crop information.

**Category:** Government & Public Data | **Website:** [upag.gov.in/](https://upag.gov.in/) | **Docs:** [parse.bot/marketplace/07fa78ed-8d38-4eeb-a4dd-9f3482166be4/upag-gov-in-api](https://parse.bot/marketplace/07fa78ed-8d38-4eeb-a4dd-9f3482166be4/upag-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-upag-gov-in-api-07fa78ed/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_all_india_crop_apy_timeseries

Returns All India crop-wise Area, Production & Yield (APY) time series data from the dashboard. Includes data for all major crops across multiple crop years and seasons (Kharif, Rabi, Summer). Returns a large dataset covering all estimation cycles. Powered by the Dash framework update-component API.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-upag-gov-in-api-07fa78ed/get_all_india_crop_apy_timeseries \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_commodity_msp

Returns Commodity-wise MSP (Minimum Support Price) trend data from the UPAG dashboard. Data includes MSP values for various crops (cereals, pulses, oilseeds) across a specified year range. Powered by the Dash framework update-component API.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `from_year` | string | No | Start year in format YYYY-YY (e.g. 2023-24, 2024-25). |
| `to_year` | string | No | End year in format YYYY-YY (e.g. 2024-25, 2025-26). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-upag-gov-in-api-07fa78ed/get_commodity_msp \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from_year":"<string>","to_year":"<string>"}'
```

### get_crop_production_estimates

Returns crop production advance estimates for a specific crop across Indian states, including production values (in Lakh Tonnes) and percentage variation from the previous year. Covers the latest estimation cycle (e.g. Third Advance Estimate).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `crop_name` | string | No | Name of the crop to query estimates for. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-upag-gov-in-api-07fa78ed/get_crop_production_estimates \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"crop_name":"<string>"}'
```

### get_domestic_crop_calendar

Returns the domestic crop calendar showing Indian states, seasons, and crops with month-wise sowing/harvesting schedules indicated by color codes (#9AC23C for harvest, #3187B9 for sowing). Each record maps a state-crop-season tuple to 12 monthly arrays.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-upag-gov-in-api-07fa78ed/get_domestic_crop_calendar \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_homepage_summary

Returns a composite homepage summary combining latest crop production advance estimates by state (map data for a default crop), estimation summaries by crop category (food grains, cereals, pulses, oilseeds, etc.), and the latest release report titles. Each sub-section is fetched from a separate upstream API and merged into one response.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-upag-gov-in-api-07fa78ed/get_homepage_summary \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_international_crop_calendar

Returns the international crop calendar showing sowing and harvest schedules for crops across countries, with month-wise color-coded indicators (#9AC23C for harvest, #3187B9 for sowing). Each record maps a country-crop tuple to 12 monthly values.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-upag-gov-in-api-07fa78ed/get_international_crop_calendar \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_latest_releases

Returns the list of latest release reports from the portal including CWWG weekly reports, crop situation reports, and other agricultural publications. Ordered by most recent first.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-upag-gov-in-api-07fa78ed/get_latest_releases \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_reports_list

Returns the full list of all available reports and dashboards on the portal, organized by category (Area Production & Yield, Market Intelligence Reports, Prices, etc.) with nested report items and submenus containing individual crop reports.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-upag-gov-in-api-07fa78ed/get_reports_list \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_reports

Searches for reports by keyword, matching against report display names, category names, URLs, and nested submenu crop names. Returns matching reports with their category, name, URL, and report ID. Search is case-insensitive substring match across all text fields.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword to match against report names, categories, URLs, and crop names within nested submenus. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-upag-gov-in-api-07fa78ed/search_reports \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
