Getting Started

Get your first search result in under 5 minutes.

1Create an Account

Sign up at /account with GitHub or Google. The free plan gives you 20 requests per day -- enough to explore the API and build a prototype.

2Get an API Key

Go to AccountAPI KeysCreate Key. Give it a descriptive name like dev-local.

Your key is shown only once. Copy it immediately and store it securely. Keys start with sk-.

3Search for Legal Documents

Make your first search request. The API uses hybrid semantic + keyword search to find relevant case law and legislation across Europe.

curl -X POST https://legaldatahunter.com/v1/search \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "right to be forgotten",
    "namespace": "case_law",
    "top_k": 5
  }'
import requests

response = requests.post(
    "https://legaldatahunter.com/v1/search",
    headers={"Authorization": "Bearer sk-your-key"},
    json={
        "q": "right to be forgotten",
        "namespace": "case_law",
        "top_k": 5
    }
)

hits = response.json()["hits"]
for hit in hits:
    print(f"{hit['score']:.2f}  {hit['title']}")
const response = await fetch("https://legaldatahunter.com/v1/search", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk-your-key",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    q: "right to be forgotten",
    namespace: "case_law",
    top_k: 5
  })
});

const { hits } = await response.json();
hits.forEach(h => console.log(`${h.score.toFixed(2)}  ${h.title}`));

The response includes scored results with titles, snippets, court information, and dates.

4Read a Document

Use a source and source_id from search results to retrieve the full document text and metadata.

curl https://legaldatahunter.com/v1/documents/FR/Judilibre/JURITEXT000048... \
  -H "Authorization: Bearer sk-your-key"
doc = requests.get(
    "https://legaldatahunter.com/v1/documents/FR/Judilibre/JURITEXT000048...",
    headers={"Authorization": "Bearer sk-your-key"}
).json()

print(doc["title"])
print(doc["text"][:500])
const doc = await fetch(
  "https://legaldatahunter.com/v1/documents/FR/Judilibre/JURITEXT000048...",
  { headers: { "Authorization": "Bearer sk-your-key" } }
).then(r => r.json());

console.log(doc.title);
console.log(doc.text.slice(0, 500));

5Resolve a Legal Reference

Turn a natural-language legal citation into an exact document. Handles references like "art. 1240 code civil", "Regulation (EU) 2016/679", or "BGH VI ZR 135/13".

curl -X POST https://legaldatahunter.com/v1/resolve \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{"reference": "art. 1240 code civil"}'
result = requests.post(
    "https://legaldatahunter.com/v1/resolve",
    headers={"Authorization": "Bearer sk-your-key"},
    json={"reference": "art. 1240 code civil"}
).json()

print(result["resolved"])
print(result["document"]["title"])
const result = await fetch("https://legaldatahunter.com/v1/resolve", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk-your-key",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ reference: "art. 1240 code civil" })
}).then(r => r.json());

console.log(result.resolved);
console.log(result.document.title);

6Explore Available Data

Use the discovery endpoints to browse what data is available before searching.

# List all countries
curl https://legaldatahunter.com/v1/discover/countries \
  -H "Authorization: Bearer sk-your-key"

# List sources for France
curl https://legaldatahunter.com/v1/discover/countries/FR/sources \
  -H "Authorization: Bearer sk-your-key"

# Get available filters for a source
curl https://legaldatahunter.com/v1/discover/sources/FR/Judilibre/filters \
  -H "Authorization: Bearer sk-your-key"

Using MCP Instead?

If you're using Claude, Cursor, or another AI assistant, the MCP integration is even simpler -- your AI calls tools directly without writing HTTP requests.

Paste https://legaldatahunter.com/mcp into your MCP client and you're ready to go. See MCP vs REST API for details, or go straight to Connect to set it up.

Next Steps

Authentication → Search Reference → MCP vs REST API →