Hydrate any canonical_id (obtained from /v1/search, /v1/cite, or /v1/graph/traverse) into its full text and structured metadata.
GET https://api.dike.it.com/v1/document/{canonical_id}
Authorization: Bearer dike_live_xxxxxxxxPath Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
canonical_id | string | Yes | Unique document identifier | eg-leg-1948-131 |
Code Examples
curl -X GET https://api.dike.it.com/v1/document/eg-leg-1948-131 \
-H "Authorization: Bearer $DIKE_API_KEY"import os
import httpx
client = httpx.Client(
base_url="https://api.dike.it.com",
headers={"Authorization": f"Bearer {os.getenv('DIKE_API_KEY')}"},
)
response = client.get("/v1/document/eg-leg-1948-131")
if response.status_code == 200:
doc = response.json()
print(f"Title: {doc['title']}")
print(f"Status: {doc['status']} | Enacted: {doc['year_gregorian']}")
print(f"Sample Full Text: {doc['full_text'][:300]}...")async function fetchDocument(canonicalId: string) {
const res = await fetch(`https://api.dike.it.com/v1/document/${canonicalId}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.DIKE_API_KEY}`,
},
});
if (res.status === 404) {
throw new Error(`Document not found: ${canonicalId}`);
}
const document = await res.json();
return document;
}Response Schema
{
"canonical_id": "eg-leg-1948-131",
"doc_type": "legislation",
"jurisdiction": "EG",
"title": "القانون المدني رقم 131 لسنة 1948",
"official_number": "131",
"year_gregorian": 1948,
"status": "in_force",
"issuing_body": "مجلس الأمة المصري",
"full_text": "نحن فاروق الأول ملك مصر...\nمادة 1: تسري النصوص التشريعية على جميع المسائل التي تتناولها هذه النصوص في لفظها أو في فحواها..."
}No article breakdown or PDF link yet
The corpus stores per-article text and a source PDF/blob reference internally, but GET /v1/document/{id} doesn't expose them yet. Only the fields above are returned today. Use the article_no and snippet on individual /v1/search results if you need article-level text.
Error Codes
| Status | Code | Cause |
|---|---|---|
401 | unauthorized | Missing or invalid API key |
404 | not_found | Specified canonical_id does not exist in the corpus |
503 | upstream_unavailable | Database hydrate service outage |