Build legal research workflows on LexGraph data
Reference documentation for the LexGraph API, including authentication, limits, search endpoints, answer generation, full text retrieval, and reference extraction.
The API exposes reference extraction, case full text retrieval, search, and answer generation through authenticated JSON endpoints.
Connection
Base URL: https://api.lexgraph.de
Send a bearer API key on every request.
What LexGraph Contains
LexGraph models legal material as connected entities. The API works with the same core types as the database and returns them as search results, full texts, references, or answer context depending on the endpoint.
- Commentary: Curated legal knowledge: terms, issue structures, explanations, and commentary text that connect provisions and decisions.
- Provision: German provisions with sections, articles, paragraphs, sentences, and structured code navigation.
- EU legal act: European regulations, directives, and decisions, including article structure and CELEX-ready references.
- Decision: German court_cases with court, file number, date, legal field, headnote, procedural history, structured full text, paragraph numbers, and citation links.
- European decision: CJEU and General Court decisions with file numbers, ECLI values, and links to European legal acts.
- Reference: Citations and source references such as file numbers, journal citations, parliamentary print documents, or BGBl references that connect entities in the graph.
- Relationship: Relationships connect two entities in the graph. They carry a weight and a free-text description so strength, relevance, and legal context remain explainable.
- Permalink: All found entities can be viewed in our database via their permalink.
Quick Start
Start with the answer endpoint when you want LexGraph to retrieve legal context and generate a response in one call.
Bearer API keys
Every request needs an Authorization header. Invalid keys return 401 with Invalid API key.
Response Formats
Search endpoints return entities and count. Set "relationships": true to include an additional relationships array; "permalinks": true adds browser-ready LexGraph links where they can be created or found.
Filters
Every direct search endpoint and POST /v1/answer accepts the same optional filters object. It applies hard constraints using metadata stored in LexGraph or derived reliably from linked entities.
Filter schema
type SearchRegion =
| "Bund"
| "EU"
| "Baden-Württemberg"
| "Bayern"
| "Berlin"
| "Brandenburg"
| "Bremen"
| "Hamburg"
| "Hessen"
| "Mecklenburg-Vorpommern"
| "Niedersachsen"
| "Nordrhein-Westfalen"
| "Rheinland-Pfalz"
| "Saarland"
| "Sachsen"
| "Sachsen-Anhalt"
| "Schleswig-Holstein"
| "Thüringen";
type SearchFilters = {
rechtsgebiete?: string[];
regionen?: SearchRegion[];
gerichte?: string[];
zeitraum?: {
von?: "YYYY-MM-DD";
bis?: "YYYY-MM-DD";
};
};Supported filter values
Switch between filter fields to inspect the canonical LexGraph values and the required format.
Legal areas
These canonical values are used in LexGraph. The API field accepts strings, but reliable matches should use one of these values.
AgrarrechtArbeitsrechtBank- und KapitalmarktrechtBau- und ArchitektenrechtBeamten und DienstrechtBerufsrechtEnergierechtErbrechtEuroparechtFamilienrechtGewerblicher RechtsschutzHandels- und GesellschaftsrechtImmobilienrechtInsolvenzrechtIT-RechtKartellrechtMedizinrechtMietrecht / WEGMigrationsrechtOrdnungswidrigkeitenSonstigesSozialrechtSteuerrechtStrafrechtTransport- und SpeditionsrechtUmweltrechtUrheberrecht und MedienrechtVerfassungsrechtVergaberechtVerkehrsrechtVersicherungsrechtVerwaltungsrechtZivil- und Zivilprozessrecht
Regions
This is the complete list of regions accepted by the request schema. Pass the values exactly as displayed.
BundEUBaden-WürttembergBayernBerlinBrandenburgBremenHamburgHessenMecklenburg-VorpommernNiedersachsenNordrhein-WestfalenRheinland-PfalzSaarlandSachsenSachsen-AnhaltSchleswig-HolsteinThüringen
Courts
Use the standardized code rather than the court's written-out name. European courts are currently not searched while filters are active.
Ordentliche Gerichtsbarkeit
AG— AmtsgerichtLG— LandgerichtOLG— OberlandesgerichtBGH— BundesgerichtshofSchiffobergericht— SchifffahrtsobergerichtBPatG— BundespatentgerichtBayObLG— Bayerisches Oberstes Landesgericht
Arbeitsgerichtsbarkeit
ArbG— ArbeitsgerichtLAG— LandesarbeitsgerichtBAG— Bundesarbeitsgericht
Verwaltungsgerichtsbarkeit
VG— VerwaltungsgerichtOVG— OberverwaltungsgerichtBVerwG— BundesverwaltungsgerichtDienstgericht— DienstgerichtDienstgerichtshof— DienstgerichtshofTruppendienstgericht— Truppendienstgericht
Sozialgerichtsbarkeit
SG— SozialgerichtLSG— LandessozialgerichtBSG— Bundessozialgericht
Finanzgerichtsbarkeit
FG— FinanzgerichtBFH— Bundesfinanzhof
Verfassungsgerichtsbarkeit
VerfG— LandesverfassungsgerichtBVerfG— Bundesverfassungsgericht
Sonstige
Vergabekammer— VergabekammerSTA— StaatsanwaltschaftGmSOGB— Gemeinsamer SenatBerGer— BerufsgerichtBerGH— BerufsgerichtshofÄrztGerHof— Ärztegerichtshof
Date range
There is no fixed list for the date range. von and bis each accept an inclusive calendar date in YYYY-MM-DD ISO format.
- From a date:
{ "von": "2020-01-01" } - Until a date:
{ "bis": "2026-08-14" } - Closed range:
{ "von": "2020-01-01", "bis": "2026-08-14" }
Combination and validation rules
- All four fields are optional. Unknown fields inside filters or zeitraum are rejected with 422.
- Multiple values inside one array use OR. Non-empty dimensions that apply to a source are combined with AND.
- gerichte matches standardized court codes such as BAG, LAG, or BGH; regionen accepts Bund, EU, or the name of a German federal state.
- zeitraum.von and zeitraum.bis are inclusive ISO dates in YYYY-MM-DD format; von may not be later than bis.
Applicable dimensions by source
| Source | Applicable filters |
|---|---|
| German court decisions | rechtsgebiete, regionen, gerichte, zeitraum |
| Federal and state statutes | rechtsgebiete, regionen |
| Concepts | rechtsgebiete |
| References and examples | Only with reliable metadata or metadata derived from links |
Filtered request
{
"query": "Which German labour-law decisions by the BAG since 2020 are relevant?",
"filters": {
"rechtsgebiete": [
"Arbeitsrecht"
],
"regionen": [
"Bund",
"Berlin"
],
"gerichte": [
"BAG",
"LAG"
],
"zeitraum": {
"von": "2020-01-01",
"bis": "2026-08-14"
}
},
"limit": 20
}Current coverage
- A dimension that does not apply to a source does not remove that source. References and examples without applicable reliable metadata are conservatively excluded.
- EU statutes and European court decisions are not included while filters are active.
- German state statutes are searched without embeddings through configured Arango Views. Views currently exist for Baden-Württemberg, Bavaria, Berlin, Hamburg, Hesse, Mecklenburg-Vorpommern, Saarland, Saxony-Anhalt, Schleswig-Holstein, and Thuringia. No state-law View is currently queried for the other six states; regional court-decision filters continue to work.
Rate, weekly, and character limits
A limit value of -1 means unlimited. Search endpoints use weekly search counters; /v1/answer uses weekly answer counters.
Data sources
data_sources limits the requested source types. Allowed values depend on the endpoint; use the source list in each endpoint description.
Graph search searches every graph-capable source internally and applies data_sources as a final output filter. limit remains an upper bound, and quality control may reduce count further.
Limit Headers
Responses include rate limit metadata. Search and answer endpoints also include weekly counters for their own quota class.
- X-RateLimit-Limit: Request limit for the current window.
- X-RateLimit-Remaining: Requests remaining in the current window.
- X-RateLimit-Reset: Window reset timestamp.
- X-SearchLimit-*: Weekly search quota metadata.
- X-AnswerLimit-*: Weekly answer quota metadata.
- Retry-After: Seconds until retry after 429.
Endpoints
These endpoints cover answer generation, reference extraction, citation validation, and full text retrieval for known decisions.
Answer Mode
Generates a legal answer through the same production Engine core used by the MCP legal-graph search.
Best For: Default integration path when you want the complete Engine answer with public source links.
- Automatic routing selects direct entity lookup, Engine Case Law, or Engine Embedding.
- General legal research benefits from query decomposition, hybrid seeds, reranking, and deduplication.
- filters and all four API data sources remain active in the shared retrieval path.
- answer includes public LexGraph Markdown links where available; the MCP-only response_contract is not part of this API response.
- Weekly answer limits apply to this endpoint, not search limits.
- Use limit to control how much retrieved context the answer can use.
Reference Extraction
Extracts structured legal references from free text.
Best For: Efficiently extract structured legal references from text.
- Detects German laws and European legal acts such as regulations, directives, and decisions.
- Use reference_types to limit extraction to selected types such as law, case, or physical_printout.
- Detects German court cases, European cases, file numbers, ECLI values, and paragraph-number context.
- Detects parliamentary print documents, BGBl references, and journal citations such as NJW 2020, 1234.
Physical Printout Match
Resolves a physical printout citation against known LexGraph decisions.
Best For: Check whether citations in your legal briefs point to known decisions.
- Maps a physical printout citation to known decisions.
- Returns every distinct case_key that correlates with the corresponding file number.
- Use the corresponding file number with /v1/cases/full_text to fetch the decision full text afterwards.
- If LexGraph does not have the decision, the endpoint returns HTTP 200 with case_keys as [] and count 0.
- Use it after reference extraction to validate journal citations from pleadings or imported documents.
Commentary References
Returns all references associated with a commentary concept.
Best For: Loading the complete source list for a known commentary concept.
- Accepts either a bare concept key or an ID prefixed with concepts/.
- Includes visible references linked through concept_to_nachweis.
- Also includes known court decisions referenced by the commentary source field.
- Results use the same entities format as the search endpoints.
- Returns 404 for unknown or non-public concepts.
Case Full Text
Returns structured content fields for a decision matched by exact file number.
Best For: Fetching tenor, facts, reasons, headnotes, and generated headnotes for a known case.
- aktenzeichen must match the decision file number exactly.
- Only non-empty structured_content fields are returned.
- Set permalinks to true to include a LexGraph case URL when available.
- If LexGraph does not have the decision, the endpoint returns 404.
Embeddings Search
Runs Engine Embedding explicitly against selected legal data sources.
Best For: Low-latency retrieval when you already know which sources you want to search.
- Uses the Engine embedding and hybrid-retrieval improvements without automatically switching to the Case-Law route.
- Supports laws, concepts, court_cases, and nachweise as data_sources.
- Supports the shared filters object for legal area, region, court, and date range.
- quality_control defaults to false; set it to true to apply the additional LLM relevance filter.
- relationships defaults to false; set it to true to include a relationships array in the response.
- limit defaults to 10 and can be at most 80.
- The displayed latency is based on 5 live runs from August 21, 2026 with all four data sources, limit 20, additional quality control disabled, permalinks enabled, and Engine rerankers active; it is not a guarantee.
Graph Search
Runs Engine Graph explicitly for complex legal retrieval tasks.
Best For: Complex research where you want graph-aware retrieval without an agent planning multiple steps.
- This is the explicit Engine Graph entry point and our state-of-the-art non-agentic search for complex tasks.
- Internally searches all graph-supported sources, then applies requested data_sources as a final output filter.
- Supports laws, concepts, court_cases, and nachweise as final data_sources filters.
- Supports the shared filters object for legal area, region, court, and date range.
- quality_control defaults to false; set it to true to filter weak matches after graph retrieval and reranking.
- relationships defaults to false; set it to true to include a relationships array in the response.
- limit defaults to 10 and can be at most 80 final entities.
- The displayed latency is based on 5 live runs from August 21, 2026 with all four data sources, limit 20, additional quality control disabled, permalinks enabled, and Engine rerankers active; it is not a guarantee.
Agentic Search
Runs Engine Agentic explicitly with bounded planning, graph/direct retrieval, and source-coverage repair.
Best For: Harder research tasks where a single semantic search is likely too shallow.
- This is the explicit Engine Agentic entry point.
- Supports laws, concepts, court_cases, and nachweise as data_sources.
- Supports the shared filters object for legal area, region, court, and date range.
- quality_control is accepted for schema compatibility but is not applied as an additional filter; agentic search uses its own graph/direct fusion and repair selection.
- relationships defaults to false; set it to true to include a relationships array in the response.
- limit defaults to 10 and can be at most 80 final entities.
- The displayed latency is based on 5 live runs from August 21, 2026 with all four data sources, limit 20, the internal step budget, permalinks enabled, and Engine rerankers active; it is not a guarantee.
Errors
Error responses use standard HTTP status codes. Use the status code and response detail to decide whether to retry, change the request, or rotate credentials.
- 401: API key is missing or invalid.
- 403: Key is disabled, expired, or missing the required scope.
- 404: Requested decision or entity was not found.
- 413: text or query exceeds max_chars_per_request.
- 422: The request schema, filter values, or data_sources are invalid or unsupported.
- 429: Rate, character, search, or answer limit was exceeded.
- 503: Reference extraction or answer generation backend is unavailable.