# 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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/upag/`
**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 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/credits/upag/get-all-india-crop-apy-timeseries \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/upag/get-commodity-msp \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/upag/get-crop-production-estimates \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/upag/get-domestic-crop-calendar \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/upag/get-homepage-summary \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/upag/get-international-crop-calendar \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/upag/get-latest-releases \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/upag/get-reports-list \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/upag/search-reports \
  -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.