DEV Community

Rachit Jain
Rachit Jain

Posted on • Originally published at blogs.ecourtsindia.com

How to Use the eCourtsIndia API: Search 27.9 Crore+ Indian Court Records

If you've ever scraped services.ecourts.gov.in, you know the pain: a single-threaded portal, captchas, and scanned-image PDFs with no OCR. The eCourtsIndia API is what you build on when scraping is no longer your day job — a clean REST interface over a structured layer of 27.9 crore+ Indian court records spanning the Supreme Court, 25 High Courts, 600+ district courts and major tribunals.

This is a condensed quick-start. The full developer guide (Python/Node samples, every search recipe, the refresh workflow and FAQs) lives on the eCourtsIndia blog: How to Use the eCourtsIndia API.

What you get

  • Case retrieval by CNR — parties, advocates, judges, hearings, orders, IAs.
  • Order text + AI analysis — OCR-cleaned markdown plus summary, outcome, relief and statutory provisions.
  • Solr full-text search across metadata and the body of every uploaded order.
  • Cause lists — daily court schedules.
  • Single & bulk refresh — pull fresh data straight from the official source.

1. Authenticate

Every call uses a Bearer token (get one at ecourtsindia.com/dashboard/settings):

curl -X GET "https://webapi.ecourtsindia.com/api/CauseList/court-structure/states" \
  -H "Authorization: Bearer eci_live_YOUR_TOKEN_HERE"
Enter fullscreen mode Exit fullscreen mode

The #1 integration error: forgetting the Bearer prefix → INVALID_TOKEN. It must be Bearer <token>.

2. Fetch a case by CNR

A CNR is the 16-character case id, [A-Z]{4}\d{12}:

curl "https://webapi.ecourtsindia.com/api/partner/case/DLHC010001232024" \
  -H "Authorization: Bearer eci_live_YOUR_TOKEN_HERE"
Enter fullscreen mode Exit fullscreen mode

The full OCR-cleaned order text is embedded in files.files[].markdownContent, so you usually don't need a second call to read an order.

3. Search like the website

Replicate the State → Court → Type → Year → Number flow using facets:

/api/partner/search?CourtCodes=DLHC01&CaseTypes=WP_C&FilingYears=2024&Query=138/2024
Enter fullscreen mode Exit fullscreen mode

Use Litigants= for party-only search (both sides). The general Query is full-text — it also reads order bodies, so quote phrases for exact matches and use uppercase AND/OR/NOT. Paginate with Page/PageSize (max 100) until hasNextPage is false.

4. Refresh (asynchronous)

POST /api/partner/case/{cnr}/refresh queues a live re-scrape and returns immediately — poll the case endpoint until dateModified advances. It even fetches CNRs not yet in the index. (It's POST, not GET — GET returns 405.)

Connect AI agents directly (MCP)

There's also a Model Context Protocol (MCP) server so Claude, Cursor, VS Code, Windsurf, ChatGPT or Gemini can query court data natively — 22 tools, no REST plumbing:

https://mcp.ecourtsindia.com/mcp?token=YOUR_API_KEY
Enter fullscreen mode Exit fullscreen mode

Docs & playgrounds

New accounts get free API credits. Full guide and pricing: ecourtsindia.com/api.

Top comments (0)