# Nyaykosh Indian Laws as Data

> Indian laws as structured JSON: sections, penalties, XML/PDF and a compliance check

- Vendor: `nyaykosh` · version 1.0 · category Compliance · tags india, law, legal, compliance, dpdp, it act, aadhaar, online gaming, legislation
- Datasource: custom HTTP routes
- Marketplace page: https://apiclay.com/api/nyaykosh
- This document: https://apiclay.com/docs/nyaykosh.md
- OpenAPI 3.1: https://apiclay.com/api/nyaykosh/openapi.json
- MCP: connect https://api.apiclay.com/v1/mcp (see https://apiclay.com/llms.txt), then `apiclay_describe_api` with vendor `nyaykosh`
- Updated: 2026-11-18

## About

## Nyaykosh - Indian Laws as Data

Indian statutes as clean, structured JSON from **Nyaykosh (Law as Code)**, the open-access platform of the National e-Governance Division (NeGD), MeitY: every section's text, the penalty schedule, the official PDF and LegalDocML XML, plus a compliance check that tells you which obligations are still open and the penalty exposure.

### Laws available today

| Law | `law` value | Sections |
|---|---|---|
| Information Technology Act, 2000 | `the-information-technology-act-2000` | 125 |
| Digital Personal Data Protection Act, 2023 | `the-digital-personal-data-protection-act-2023` | 44 |
| Aadhaar Act, 2016 | `the-aadhaar-targeted-delivery-of-financial-and-other-subsidies-benefits-and-services-act-2016` | 69 |
| Promotion and Regulation of Online Gaming Act, 2025 | `the-promotion-and-regulation-of-online-gaming-act-2025` | 20 |

All four are in the category **Governance** with status **In force**, so `category=Governance` or `status=In force` returns all of them. `/categories` returns the category names Nyaykosh has defined (Data Protection, Cyber Law, Consumer, Corporate, Financial ...), but no law is filed under those yet, so filtering by them returns an empty list today. To find a law by subject, use `q` instead, for example `q=data` or `q=aadhaar`. More laws are added over time; `/laws` always returns the current list.

### Quick start

Send your ApiClay token in the `token` header.

```bash
curl -G 'https://api.apiclay.com/v1/api/nyaykosh/laws' \
  -H 'token: YOUR_TOKEN' \
  --data-urlencode 'q=data'
```

Returns a list of laws. Each has `title`, `year`, `category`, `status`, `authority`, `shortDesc`, `sections` (count), `apiSlug` (use it as `law`), `provisions` and `penalties`.

### Read a law

```bash
curl -G 'https://api.apiclay.com/v1/api/nyaykosh/law/sections' \
  -H 'token: YOUR_TOKEN' \
  --data-urlencode 'law=the-information-technology-act-2000'
```

- `/law` - the whole law: metadata, every section and the penalty schedule.
- `/law/sections` - the sections only: `num`, `title`, `text` and `rules` (the rules made under it).
- `/law/section` - one section: add `provision` with the section `num` (e.g. `43A`).
- `/law/penalties` - the penalty schedule: `breach`, `max`, `unit` (e.g. crore) and `text`.
- `/law/xml` and `/law/pdf` - the LegalDocML XML and the official PDF of the law as files.

```bash
curl -G 'https://api.apiclay.com/v1/api/nyaykosh/law/section' \
  -H 'token: YOUR_TOKEN' \
  --data-urlencode 'law=the-information-technology-act-2000' \
  --data-urlencode 'provision=43A'
```

### Compliance check

1. Call `/compliance/personas`. Each persona (a role such as Data Principal, Data Fiduciary, Certifying Authority or Online Gaming Service Provider) has a `lawId` and `triggers`; each trigger has `rules`, and each rule has `actions` (the obligations), `clauses` and `penalty`.
2. POST to `/compliance/check` with the persona, the trigger and the actions you have already done. An action key is `{ruleId}::action::{n}`, where n is the action's position in the rule's `actions` list starting at 0.

```bash
curl -X POST 'https://api.apiclay.com/v1/api/nyaykosh/compliance/check' \
  -H 'token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"personaId": "persona_data_principal", "triggerId": "persona_data_principal-applies", "checkedKeys": ["persona_data_principal-r1::action::0"]}'
```

The answer lists every rule in `perRule` (`status`, `checked` of `total`, `missingActions`) and the totals `compliant`, `nonCompliant`, `overallPercent`, `totalExposure` (maximum penalty in crore rupees) and `riskLevel`.

### Notes

- Source: Nyaykosh, NeGD (https://lawascode.negd.in), returned unchanged. For information only, not legal advice.
- Not affiliated with or endorsed by NeGD, MeitY or the Government of India.

## Pricing

- Pay as you go: 0.0029 credits/request
- Trial: 10 free requests per buyer
- Billing order: trial requests -> subscribed plan requests -> pay as you go. 1 credit's USD value is shown on the marketplace page.

## HTTP routes

Only the public, buyer-facing parts of each route are listed; vendor-side credentials stay on the gateway.

### GET /laws — List laws
- Gateway: `GET https://api.apiclay.com/v1/api/nyaykosh/laws`
- Public query params: `category` (string), `status` (string), `q` (string)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 5 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /law — Get one law (all sections and penalties)
- Gateway: `GET https://api.apiclay.com/v1/api/nyaykosh/law`
- Public query params: `law` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 5 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /law/sections — List a law's sections
- Gateway: `GET https://api.apiclay.com/v1/api/nyaykosh/law/sections`
- Public query params: `law` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 5 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /law/section — Get one section of a law
- Gateway: `GET https://api.apiclay.com/v1/api/nyaykosh/law/section`
- Public query params: `law` (string, required), `provision` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 5 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /law/penalties — Penalty schedule of a law
- Gateway: `GET https://api.apiclay.com/v1/api/nyaykosh/law/penalties`
- Public query params: `law` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 5 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /law/xml — Law as LegalDocML XML
- Gateway: `GET https://api.apiclay.com/v1/api/nyaykosh/law/xml`
- Public query params: `law` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 5 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /law/pdf — Law as official PDF
- Gateway: `GET https://api.apiclay.com/v1/api/nyaykosh/law/pdf`
- Public query params: `law` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 5 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /categories — Category names (today every law is in Governance)
- Gateway: `GET https://api.apiclay.com/v1/api/nyaykosh/categories`
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 5 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /compliance/personas — Compliance personas and their rules
- Gateway: `GET https://api.apiclay.com/v1/api/nyaykosh/compliance/personas`
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 5 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### POST /compliance/check — Compliance check (what is missing, penalty exposure)
- Gateway: `POST https://api.apiclay.com/v1/api/nyaykosh/compliance/check`
- Body sample (JSON):

```json
{"personaId": "persona_data_principal", "triggerId": "persona_data_principal-applies", "checkedKeys": ["persona_data_principal-r1::action::0"]}
```

- Upstream proxy: ApiClay proxy paid by the vendor (data cap 5 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

## Call example

```bash
curl -X GET "https://api.apiclay.com/v1/api/nyaykosh/laws" \
  -H "token: <YOUR_APICLAY_TOKEN>"
```

Index of every published API: https://apiclay.com/llms.txt
