Overview
Teams building search, retrieval or document workflows on Indian case law need two things for each order: clean text a machine can index, and a document a person can file or share. The Order Text API delivers both for one order at a time. Legal tech builders feed the Markdown into search and question-answering systems, and law firms keep the signed PDF in the matter file.
The response carries markdownContent with the order text and pdfBase64 with the PDF. By default the PDF is the eCourtsIndia certified true copy, watermarked and digitally signed; pass signed=false for the raw court PDF. The text is unaffected either way. If you only need text, the Case Details API already includes it under files, and for a structured analysis use the Order AI Summary API.
- Input
- CNR plus the bare order filename from orderUrl; optional signed=false
- Returns
- markdownContent (order text) and pdfBase64 (signed true copy or raw court PDF)
- Coverage
- Orders and judgments attached to cases in the eCourtsIndia corpus
- Freshness
- Real-time conversion; can take up to 300 seconds on first request
- Auth
- Bearer API key or OAuth via the MCP server
- Register
- eCourtsIndia (ecourtsindia.com)
- MCP tool
get_order_markdown- Data source
- Public court records published by the Supreme Court, High Courts, district courts and tribunals, harvested daily and refreshed on demand.
What it returns
markdownContentThe order text in Markdown, with headings and paragraphs preserved; may be null if conversion failed
pdfBase64The order PDF encoded as base64
signed (query)true by default for the watermarked, signed true copy; false for the raw court PDF
meta.request_idIdentifier of the request, useful for support
Retry-After (header on 429)Seconds to wait when the conversion pipeline answers TOO_MANY_CONVERSIONS
error.codeMachine-readable error such as ORDER_NOT_FOUND or INVALID_FILENAME
Use cases
Retrieval for a legal assistant
A legal tech team building a question-answering tool over a client's matters pulls every order as Markdown, splits it into passages and indexes them. When the tool answers, it cites the order and links the signed PDF, so the lawyer can open the exact document the answer came from.
Signed copies for the matter file
A law firm attaching orders to a client report wants a copy that shows where it came from. The default response gives the watermarked, digitally signed true copy alongside the text, which the firm stores in its document system with the CNR and order date.
Full-text search over a portfolio
A company's legal department tracking two hundred disputes converts each new order to Markdown and adds it to an internal search index. In-house counsel can then search their own litigation for a phrase, a judge or a section and jump to the order.
How to use it
- Get the CNR and the bare order filename from judgmentOrders[].orderUrl or interimOrders[].orderUrl in the Case Details API.
- Call GET /api/partner/case/{cnr}/order-md/{filename}; add signed=false if you want the raw court PDF.
- Allow a long timeout, up to 300 seconds, because the conversion runs in real time.
- On 429 TOO_MANY_CONVERSIONS, wait for the Retry-After duration and try again.
- Decode pdfBase64 to a file and store markdownContent with the CNR and order date.
Parameters
cnr required path Case Number Record. Example: DLHC010001232024 filename required path Bare filename of the order. Example: order-2024-02-01.pdf signed query false returns the raw court PDF without watermark or signature. Example: true Example
Request
curl "https://webapi.ecourtsindia.com/api/partner/case/DLHC010001232024/order-md/order-2024-02-01.pdf?signed=true" \
-H "Authorization: Bearer eci_live_YOUR_KEY" Response (illustrative)
// GET /api/partner/case/KAHC010098762022/order-md/order-4.pdf
{
"data": {
"pdfBase64": "JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFI...",
"markdownContent": "# ORDER\n\nBefore: Hon'ble Justice A. Verma\n\nDate of Hearing: 2026-09-18\n\nExample Traders Pvt Ltd ... Appellant\n\nVersus\n\nR. Kumar ... Respondent\n\n1. Heard learned counsel for the parties ..."
},
"meta": { "request_id": "req_example004" }
}
// If the conversion pipeline is busy: HTTP 429 with a Retry-After header
{
"error": {
"code": "TOO_MANY_CONVERSIONS",
"message": "PDF conversion pipeline overloaded. Check Retry-After header.",
"details": []
},
"meta": { "request_id": "req_example004b" }
} Authenticate with Authorization: Bearer eci_live_…. Every response field is documented in the eCourtsIndia API documentation. Assistants can also call this through the eCourtsIndia MCP server as the get_order_markdown tool.
Glossary
- Certified true copy
- Here, a PDF of the court order that eCourtsIndia stamps with a watermark and a digital signature to show its source and that it has not been altered. Pass signed=false to receive the court's original file instead.
- Markdown
- A plain-text format that marks headings, lists and emphasis with simple symbols. It keeps the structure of an order readable for people while staying easy for search engines and language models to split and index.
- CNR (Case Number Record)
- The unique 16-character identifier eCourts gives every case. It is a six-character court establishment code such as DLHC01, a six-digit case number and the four-digit filing year, so DLHC010351552024 is Delhi High Court case 035155 of 2024.
Good to know
- Conversion can take up to 300 seconds; 429 TOO_MANY_CONVERSIONS means wait for Retry-After.
- markdownContent may be null if conversion failed.
Frequently asked questions
How can I get the text of an Indian court order through an API?
Call GET /api/partner/case/{cnr}/order-md/{filename} with your Bearer API key. The response includes markdownContent with the order text and pdfBase64 with the PDF. The Case Details API also includes order text under files, so use this endpoint when you need the PDF as well.
Is the PDF a certified copy?
By default the PDF is a certified true copy issued by eCourtsIndia: watermarked and digitally signed to show its source. Pass signed=false to receive the raw PDF exactly as the court published it, without watermark or signature. The Markdown text is the same either way.
Why does the request take so long?
The endpoint runs a real-time PDF conversion pipeline, so a request can take up to 300 seconds. If the pipeline is busy it answers 429 TOO_MANY_CONVERSIONS with a Retry-After header; wait that long and retry. For plain text, the Case Details response is faster.
How does this compare with downloading an order PDF from the court website?
The court website gives you a PDF for one order after you find the case and solve a captcha, and the PDF is often a scan. This API returns clean, indexable text and a signed PDF in one JSON response, keyed by CNR and filename, so a pipeline can process orders without manual downloads.
Can I use the order text in a RAG or LLM pipeline?
Yes. markdownContent is designed for that: headings and paragraphs are preserved so you can split it into passages, embed them and cite the order back to the CNR. Keep the CNR and order date with each passage so answers can link to the source.
Can an AI assistant fetch an order for me?
Yes. On the eCourtsIndia MCP server the get_order_markdown tool returns the extracted text plus the signed true-copy PDF, or the court original with signed=false. It checks the date inside the document against the order index and reports DATE VERIFIED or WRONG DOCUMENT.