{"openapi":"3.1.0","info":{"title":"lagen.nu API","description":"\nSearch, the catalog and the citation graph over the Swedish legal corpus:\nstatutes (SFS), case law, preparatory works, agency regulations, EU law and\nCouncil of Europe / ECHR material.\n\n**A document's canonical uri is its identity everywhere.** The published\n`https://lagen.nu/<id>` uri is at once this API's key (`?uri=…`), the bulk-dump\nline id and the search index `_id`, and it is stable across versions. Uris are\nalways a `uri` query parameter, never a path segment -- they contain `:` and\n`/`.\n\n**The JSON artifact is the source of truth.** The catalog and the search index\nare derived from it and rebuildable. `GET /api/v1/document` hands it back\nverbatim, and each line of a bulk dump *is* one.\n\n**Everything here is read-only and open to any origin** (`GET`, `*`). An error\nis `{\"detail\": …}`; a 404 or a 5xx adds an `error_id` that names the entry in\nthe server's own error ledger, worth quoting in a bug report -- `null` on the\nrare occasion the ledger itself could not be written. (On a 422 the `detail` is\nFastAPI's list of validation errors, not a message.)\n\nFor reprocessing the whole corpus use the NDJSON dumps rather than paging these\nendpoints -- `GET /api/v1/dumps` is the manifest.\n","version":"1.0"},"paths":{"/api/v1/search":{"get":{"tags":["search"],"summary":"Search the corpus, with citations resolved","description":"Full-text search, with a citation-aware twist: when the query reads as a\ncitation (a law nickname/abbreviation + pinpoint, an EU act + article, or a\ncase nickname), the exact resource is resolved and pinned as the first\nresult -- so ⌘K + Enter lands on the right §/article, which plain full-text\ncan't do (the name appears nowhere in the text). That resolved provision is\nthe hit's `pin`, and it is the only thing that moves a hit's link off the\ndocument. The rest is the usual full-text ranking (relevance combined with\ncitation count); each hit carries the document's own snippet plus, in\n`fragments`, the passages inside it where the query matched.\n\nResolution runs on the first page only, and is best-effort: an unbuilt\ncatalog costs the pin, not the search.\n\nPaging: follow `next_cursor` until it comes back null. `offset` is the\nbounded random-access alternative (up to 9 900) and the two are mutually\nexclusive. `facets` counts each field against the *other* selected filters,\nso a bucket's count stays a usable answer to \"what if I widen this?\"; every\nbucket carries a reader-facing `label` where its raw value is not one.\n\nThis is the one endpoint that needs a running OpenSearch and a built index\n-- 503 when either is missing. The catalog endpoints answer without it.","operationId":"search_endpoint_api_v1_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","description":"free-text query","title":"Q"},"description":"free-text query"},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"restrict to one source -- any name /api/v1/sources lists (sfs, dv, forarbete, eurlex, hudoc, …)","title":"Source"},"description":"restrict to one source -- any name /api/v1/sources lists (sfs, dv, forarbete, eurlex, hudoc, …)"},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"restrict to a document kind within the source (lag, forordning, case, prop, sou, directive, …)","title":"Kind"},"description":"restrict to a document kind within the source (lag, forordning, case, prop, sou, directive, …)"},{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}],"description":"restrict to a four-digit publication/decision year","title":"Year"},"description":"restrict to a four-digit publication/decision year"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":9900,"minimum":0},{"type":"null"}],"description":"bounded random access, raw result stream (no related-hit decluttering); omit it and page by cursor for the decluttered stream","title":"Offset"},"description":"bounded random access, raw result stream (no related-hit decluttering); omit it and page by cursor for the decluttered stream"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"description":"opaque cursor returned by the previous page","title":"Cursor"},"description":"opaque cursor returned by the previous page"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facets":{"get":{"tags":["catalog"],"summary":"A source's navigation buckets and their counts","description":"The navigation facets for a source: the ordered buckets (one or two levels\n-- a law's subject initial, a case's court + year) with document counts, plus\nthe default landing bucket. The lightweight navigator; for the listings too\nuse /browse. A flat listing of a whole source is too large to be useful.","operationId":"facets_endpoint_api_v1_facets_get","parameters":[{"name":"source","in":"query","required":true,"schema":{"type":"string","description":"a faceted source: sfs, dv, forarbete, foreskrift, avg, rs, begrepp, eurlex, edpb, hudoc, coe, icrc, untc, icc, icj. A source with no facet scheme is a 404.","title":"Source"},"description":"a faceted source: sfs, dv, forarbete, foreskrift, avg, rs, begrepp, eurlex, edpb, hudoc, coe, icrc, untc, icc, icj. A source with no facet scheme is a 404."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacetTree"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/browse":{"get":{"tags":["catalog"],"summary":"The same buckets, with each leaf's documents","description":"The complete browse model for a source: the facet navigator *plus* each\nleaf bucket's ordered, display-labelled documents. The single payload the\nstatic-site generator consumes to write the browse pages -- it has no other\naccess to the data store.","operationId":"browse_endpoint_api_v1_browse_get","parameters":[{"name":"source","in":"query","required":true,"schema":{"type":"string","description":"a faceted source: sfs, dv, forarbete, foreskrift, avg, rs, begrepp, eurlex, edpb, hudoc, coe, icrc, untc, icc, icj. A source with no facet scheme is a 404.","title":"Source"},"description":"a faceted source: sfs, dv, forarbete, foreskrift, avg, rs, begrepp, eurlex, edpb, hudoc, coe, icrc, untc, icc, icj. A source with no facet scheme is a 404."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacetTree"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents":{"get":{"tags":["document"],"summary":"Enumerate documents by source and kind","description":"List document ids + top-level metadata, filtered by source/kind and\npaginated -- the catalog index that drives /document lookups. This is *not*\nfull-text search (that is /search, which requires a query); it enumerates the\ncorpus. `source_url` is the publisher's page where known; `updated` is the\nartifact's last-build time.","operationId":"documents_endpoint_api_v1_documents_get","parameters":[{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"restrict to one source -- any name /api/v1/sources lists","title":"Source"},"description":"restrict to one source -- any name /api/v1/sources lists"},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"restrict to a document kind within the source (lag, forordning, case, prop, sou, directive, …)","title":"Kind"},"description":"restrict to a document kind within the source (lag, forordning, case, prop, sou, directive, …)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document":{"get":{"tags":["document"],"summary":"One document and its full parsed artifact","description":"One document, whole: its catalog metadata plus the parsed artifact --\nthe structure/body with every citation inline.\n\nThe artifact is the source of truth; everything else this API answers is\nderived from it. Each source owns its own shape (a statute nests into\nkapitel/paragraf/stycke, a förarbete is a flat page-precise list), but one\nrule is universal: every renderable text value is a *list of inline runs*,\neach element either a plain string or a link dict\n`{predicate, uri, text}`. Those link dicts are the citation graph -- the\ncatalog is an index over them.\n\n`format=md` swaps the artifact for the body rendered as markdown --\nheadings, paragraph designations, lists, tables, citations as inline\nlinks -- for consumers that want a reading text (a human, an LLM, a RAG\nchunker) rather than the tree. The envelope and metadata stay JSON.\n\nThe same object comes back per line in the bulk dumps, so a consumer\nreprocessing the whole corpus should take the dumps and never call this\nendpoint in a loop. See docs/api/README.md for the per-source shapes.","operationId":"document_endpoint_api_v1_document_get","parameters":[{"name":"uri","in":"query","required":true,"schema":{"type":"string","description":"full lagen.nu document uri","title":"Uri"},"description":"full lagen.nu document uri"},{"name":"format","in":"query","required":false,"schema":{"enum":["json","md"],"type":"string","description":"body format: 'json' (default) returns the parsed artifact verbatim, 'md' the body rendered as markdown","default":"json","title":"Format"},"description":"body format: 'json' (default) returns the parsed artifact verbatim, 'md' the body rendered as markdown"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Document"},{"$ref":"#/components/schemas/MarkdownDocument"}],"title":"Response Document Endpoint Api V1 Document Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document/versions":{"get":{"tags":["document"],"summary":"A statute's archived consolidations","description":"A statute's archived historical consolidations (lydelser), oldest\nfirst -- each one browsable at its own page and diffable via\n/api/v1/document/diff. Amendment dates and preparatory works are joined\nin from the statute's register where known.\n\nStatutes only: SFS is the one source the pipeline consolidates over time,\nso any other uri is a 404. The *current* consolidation is not in the list\n-- it is what /document returns, and it is what /diff compares against when\n`to` is omitted.","operationId":"versions_endpoint_api_v1_document_versions_get","parameters":[{"name":"uri","in":"query","required":true,"schema":{"type":"string","description":"full lagen.nu statute uri","title":"Uri"},"description":"full lagen.nu statute uri"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document/diff":{"get":{"tags":["document"],"summary":"Two consolidations compared, as marked-up HTML","description":"Compare two consolidations of a statute: the newer text in document\norder with every difference from the older marked up (<ins>/<del>) -- an\nHTML fragment, ready to swap into the page (the old ?diff=true view).\nVersion ids are consolidation cutoffs from /api/v1/document/versions.\nDirection is always older -> newer regardless of argument order (the\ncurrent consolidation is by definition newest); the fragment leads with a\nnote naming both endpoints.","operationId":"diff_endpoint_api_v1_document_diff_get","parameters":[{"name":"uri","in":"query","required":true,"schema":{"type":"string","description":"full lagen.nu statute uri","title":"Uri"},"description":"full lagen.nu statute uri"},{"name":"from","in":"query","required":true,"schema":{"type":"string","description":"older version id, e.g. 2003:466","title":"From"},"description":"older version id, e.g. 2003:466"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"newer version id (default: the current consolidation)","title":"To"},"description":"newer version id (default: the current consolidation)"}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document/inbound":{"get":{"tags":["document"],"summary":"Who cites this document","description":"Which other documents cite `uri` (the killer feature as data) -- one entry\nper (citing document, spot it cites from, provision cited).\n\n`scope=tree`, the default, answers for the uri **and everything inside it**:\non a law that is every citation of every paragraf, which is what mirroring\nlagen.nu's own pages takes -- brottsbalken was cited 40 696 times as an act\nand 162 909 times counting its 2 844 cited provisions when this was measured\n(2026-08-07), and reaching those the old way meant one call per provision. `scope=exact` is the narrow question\n(only rows naming `uri` itself), which is what this endpoint used to answer.\n\nOrdered as the site's context rail orders its panels -- case law first for a\nstatute, then decisions, then the citation graph -- so the first page is\nrepresentative rather than whichever source name sorts earliest. That order\nis total and build-independent, so `offset` paging is stable (`sort` can\nchange that -- see below).\n\n**Which of these matter?** Every row carries the citing document's own\n`inbound_count` -- how many documents cite *it* -- so the answer ranks\nitself without a call per row. `sort=citations` orders the whole scope by\nit, biggest first.\n\n**Pair that with `source=dv` when the question is about case law.** A\nstatute or a proposition is cited an order of magnitude more often than any\njudgment, so unfiltered `sort=citations` answers with legislation and\npreparatory works and never reaches a case: on avtalslagen 36 § the top\nthree are SFS 1994:1512 (955), Prop. 2007/08:95 (946) and Prop. 2004/05:85\n(681), while the most-cited *case* on that paragraf -- NJA 1987 s. 394, Den\nkollektiva hemförsäkringen -- has 32, and leads once the filter is on. The\nfilter is also much the cheaper question: 300 citers against 893.\n\nRead the count as a hint, not a verdict: it favours an old case over a\nrecent one and counts only what this corpus holds.\n\n`sort=citations` is the one order `offset` paging is **not** stable under\nacross rebuilds -- the count is recomputed every build, so a row can move\nbetween pages as the corpus grows. Ties fall back to the rail order, which\nis stable. Page a ranked answer in one sitting, or take the first page and\nstop.\n\nThe complete set, unreduced: the site folds a document's repeated citations\ninto one line and hides whole-document citations superseded by a pinpointed\none, and both are presentation. `predicate` separates the typed relations\n(bemyndigande, ändrar, upphäver) and `source` the commentary. The citation's\nsurface text is not carried -- it belongs to the citing document, and\n`/document/outbound` on that uri has it.","operationId":"inbound_endpoint_api_v1_document_inbound_get","parameters":[{"name":"uri","in":"query","required":true,"schema":{"type":"string","description":"document or fragment uri","title":"Uri"},"description":"document or fragment uri"},{"name":"scope","in":"query","required":false,"schema":{"type":"string","pattern":"^(tree|exact)$","description":"tree: uri and everything inside it (default); exact: only citations naming uri itself","default":"tree","title":"Scope"},"description":"tree: uri and everything inside it (default); exact: only citations naming uri itself"},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"only citations from one corpus (dv, forarbete, sfs, …)","title":"Source"},"description":"only citations from one corpus (dv, forarbete, sfs, …)"},{"name":"sort","in":"query","required":false,"schema":{"type":"string","pattern":"^(rail|citations)$","description":"rail: the context rail's order (default); citations: most-cited citing document first","default":"rail","title":"Sort"},"description":"rail: the context rail's order (default); citations: most-cited citing document first"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"default":10000,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundCitations"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/document/outbound":{"get":{"tags":["document"],"summary":"What this document cites","description":"Every citation a document makes -- the mirror of /document/inbound, and\n`uri` here is the *citing* document.\n\nOne row per citation, in document order, carrying the surface text the\nciting document actually wrote (\"6 § räntelagen\"). That text lives on this\nside only: the inbound answer cannot have it, because it belongs to the\nciter, not to the cited provision.\n\nA target the corpus does not (yet) hold comes back with `hosted: false` and\nno label/title/source -- the citation is real either way, and roughly one\nin twenty points outside what is held here.\n\nThe same links sit inline in the artifact `/document` returns; this is the\nflat, already-resolved view of them.","operationId":"outbound_endpoint_api_v1_document_outbound_get","parameters":[{"name":"uri","in":"query","required":true,"schema":{"type":"string","description":"citing document uri","title":"Uri"},"description":"citing document uri"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Citation"},"title":"Response Outbound Endpoint Api V1 Document Outbound Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sources":{"get":{"tags":["catalog"],"summary":"The corpus' sources and their document counts","description":"Every source in the corpus and how many documents it holds.\n\nThe `source` names here are exactly what the `source` parameter of /search,\n/documents, /facets and /browse takes, so this is the endpoint to call\nfirst when writing against the API -- the set grows as sources are added,\nand hardcoding it dates.","operationId":"sources_endpoint_api_v1_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SourceInfo"},"type":"array","title":"Response Sources Endpoint Api V1 Sources Get"}}}}}}},"/api/v1/graph":{"get":{"tags":["document"],"summary":"A node's neighbourhood in the citation graph","description":"One node's neighborhood in the citation graph, aggregated per neighbor\ndocument and ready to draw -- what the /hanvisningar/ explorer walks.\n\nEach neighbor row is a distinct document with the link count between the\ntwo; `/document/inbound` has the same facts one citation per row. A\nfragment uri (`...#K4P7`) answers for that provision alone and adds\n`internal`: the whole document's provision-to-provision citation graph at\nunit (§/article) level.","operationId":"graph_endpoint_api_v1_graph_get","parameters":[{"name":"uri","in":"query","required":true,"schema":{"type":"string","description":"document or fragment uri","title":"Uri"},"description":"document or fragment uri"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","pattern":"^(in|out|both)$","description":"which sides of the neighborhood to answer","default":"both","title":"Direction"},"description":"which sides of the neighborhood to answer"},{"name":"groups","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"comma-separated flow-group filter (Författningar, Rättsfall, …)","title":"Groups"},"description":"comma-separated flow-group filter (Författningar, Rättsfall, …)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":300,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/facsimile":{"get":{"tags":["document"],"summary":"A PNG of one printed page of the source PDF","description":"A facsimile PNG of one printed page of the document's source PDF\n(förarbeten, myndighetsföreskrifter, avgöranden), rendered at retina\nresolution (150 DPI) on first request and cached on disk. `bbox` crops to a\nregion of that page -- what a figure inside a förarbete is.","operationId":"facsimile_endpoint_api_v1_facsimile_get","parameters":[{"name":"uri","in":"query","required":true,"schema":{"type":"string","description":"full lagen.nu document uri","title":"Uri"},"description":"full lagen.nu document uri"},{"name":"sid","in":"query","required":true,"schema":{"type":"integer","minimum":1,"description":"printed page number (the #sid{N} anchor)","title":"Sid"},"description":"printed page number (the #sid{N} anchor)"},{"name":"bbox","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"crop to x0,y0,x1,y1 in PDF points from the page's top-left; omit for the whole page","title":"Bbox"},"description":"crop to x0,y0,x1,y1 in PDF points from the page's top-left; omit for the whole page"}],"responses":{"200":{"description":"Successful Response","content":{"image/png":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/dv-verdict":{"get":{"tags":["document"],"summary":"The original verdict PDF behind a decision","description":"The original verdict PDF a decision was first served as, before its NJA\nreferat was published (\"Ursprunglig dom\", R2). Served from the DV download\nstore. The path segments are validated so a crafted request can't escape it.","operationId":"dv_verdict_endpoint_api_v1_dv_verdict_get","parameters":[{"name":"court","in":"query","required":true,"schema":{"type":"string","description":"court code (domstolKod), e.g. HDO","title":"Court"},"description":"court code (domstolKod), e.g. HDO"},{"name":"id","in":"query","required":true,"schema":{"type":"string","description":"the record's UUID","title":"Id"},"description":"the record's UUID"},{"name":"file","in":"query","required":true,"schema":{"type":"string","description":"the PDF attachment filename","title":"File"},"description":"the PDF attachment filename"}],"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/pdf":{"get":{"tags":["document"],"summary":"A document typeset for paper, as PDF","description":"The page typeset for paper as a PDF: A4, running headers, \"n (total)\"\nfolios, a PDF outline -- the same print stylesheet the browser uses, plus\nthe paged-media layer browsers skip. `toc` adds the page's own TOC with\nresolved page numbers; `kontext` prints the chosen context kinds under\neach provision, the way the screen page shows them in the rail.\n`andringar` controls the SFS amendment register. `kolumner=2` uses the\ncompact two-column layout and omits context.","operationId":"pdf_endpoint_api_v1_pdf_get","parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string","description":"public page path, e.g. /1998:204 or /prop/2020/21:22","title":"Path"},"description":"public page path, e.g. /1998:204 or /prop/2020/21:22"},{"name":"toc","in":"query","required":false,"schema":{"type":"boolean","description":"prepend an Innehåll section whose entries carry printed page numbers","default":false,"title":"Toc"},"description":"prepend an Innehåll section whose entries carry printed page numbers"},{"name":"kontext","in":"query","required":false,"schema":{"type":"string","description":"comma-separated context kinds to print under each provision/section (the rail's slugs, e.g. kommentar,dv,forarbete), or 'alla'","default":"","title":"Kontext"},"description":"comma-separated context kinds to print under each provision/section (the rail's slugs, e.g. kommentar,dv,forarbete), or 'alla'"},{"name":"andringar","in":"query","required":false,"schema":{"type":"boolean","description":"include the SFS amendment and transition-provision register","default":true,"title":"Andringar"},"description":"include the SFS amendment and transition-provision register"},{"name":"kolumner","in":"query","required":false,"schema":{"type":"integer","maximum":2,"minimum":1,"description":"one or two text columns; two columns omit context","default":1,"title":"Kolumner"},"description":"one or two text columns; two columns omit context"},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","description":"serve as attachment (download) instead of inline (display)","default":false,"title":"Download"},"description":"serve as attachment (download) instead of inline (display)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sfs-graphic":{"get":{"tags":["document"],"summary":"A graphic the consolidated statute text omits","description":"A PNG crop of a graphic/formula/map the consolidated SFS text omits,\ncut from the published PDF of the amendment that set it (per the reviewed\n.graphics layer), rendered on first request and cached. Two resolutions, one\nper use: the inline thumbnail, and `stor=1` for the lightbox. A page of road\nsigns asks for hundreds of the first and one of the second, so serving the\nlarge one to both would cost the reader megabytes nothing on screen uses.","operationId":"sfs_graphic_endpoint_api_v1_sfs_graphic_get","parameters":[{"name":"uri","in":"query","required":true,"schema":{"type":"string","description":"full lagen.nu SFS uri","title":"Uri"},"description":"full lagen.nu SFS uri"},{"name":"node","in":"query","required":true,"schema":{"type":"string","description":"stable graphic-gap key (the data-grafik value, e.g. g-a1b2…)","title":"Node"},"description":"stable graphic-gap key (the data-grafik value, e.g. g-a1b2…)"},{"name":"v","in":"query","required":false,"schema":{"type":"string","description":"opaque cache-buster (the bbox version); accepted and ignored","title":"V"},"description":"opaque cache-buster (the bbox version); accepted and ignored"},{"name":"stor","in":"query","required":false,"schema":{"type":"boolean","description":"render the crop for full-size viewing (the lightbox) rather than for the thumbnail printed in the text; no effect on a gap whose layer entry names a whole page rather than a rectangle of one","default":false,"title":"Stor"},"description":"render the crop for full-size viewing (the lightbox) rather than for the thumbnail printed in the text; no effect on a gap whose layer entry names a whole page rather than a rectangle of one"}],"responses":{"200":{"description":"Successful Response","content":{"image/png":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/dumps":{"get":{"tags":["catalog"],"summary":"The NDJSON bulk dumps on offer","description":"The NDJSON bulk dumps on offer, one per source -- the right way to take\nthe whole corpus.\n\nA *manifest*, not a download route: it reports each dump's source, file\nname and size, and the files themselves are served beside the API at\n`/dumps/<file>` (by the reverse proxy, because the set is several\ngigabytes and wants sendfile and byte ranges).\n\nEach line of a dump is one source artifact, minified, with nothing removed\nor transformed -- the same object `/document` returns in `artifact`.\nBecause the citation graph sits inline in each artifact, a line is\nself-contained: reprocessing the corpus needs no second call. Documents\nthat parsed to nothing are omitted.","operationId":"dumps_endpoint_api_v1_dumps_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DumpInfo"},"type":"array","title":"Response Dumps Endpoint Api V1 Dumps Get"}}}}}}}},"components":{"schemas":{"BrowseDoc":{"properties":{"uri":{"type":"string","title":"Uri","description":"the canonical uri"},"url":{"type":"string","title":"Url","description":"the hosted page path (/2018:585, /dom/nja/…)"},"display":{"type":"string","title":"Display","description":"the listing handle: law name, short label, or bare id"},"short_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Id","description":"the bare id shown as the bold linked term"},"short_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Title","description":"the short human name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"the source's one-line description -- a case's sammanfattning"},"variant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant","description":"dv only: the case-law form (dom/referat/notis) the listing groups under"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date","description":"dv only: the avgörandedatum bare domar sort by"},"pre":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pre","description":"sfs only: the subdued designation/number prefix of the title"},"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key","description":"sfs only: the emphasised sort subject of the title"},"subdued":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Subdued","description":"sfs only: false for primary law, true for the rest (rendered subdued)"},"year":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Year","description":"sfs only: its year"},"amendments":{"anyOf":[{"items":{"$ref":"#/components/schemas/BrowseDoc"},"type":"array"},{"type":"null"}],"title":"Amendments","description":"föreskrift only: the ändringsförfattningar nested under their base regulation"},"consolidated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Consolidated","description":"föreskrift only: this entry is the konsoliderade version, and the text as promulgated lives at <uri>/grund"}},"type":"object","required":["uri","url","display"],"title":"BrowseDoc","description":"A leaf entry in a browse listing -- what one line of a generated browse\npage says. Only /browse populates these; /facets stops at the counts."},"Citation":{"properties":{"uri":{"type":"string","title":"Uri","description":"the cited target: a document uri or a fragment of one"},"anchor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anchor","description":"where in the citing document the citation sits"},"predicate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Predicate","description":"the relation, when it is a typed one (rpubl:bemyndigande, rpubl:andrar, rpubl:upphaver); dcterms:references is the plain reference"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"the citation's own surface text, as the citing document wrote it (\"6 § räntelagen\")"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"the target's printed id; null when the target is not hosted"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"the target's title; null when the target is not hosted"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"the target's corpus; null when the target is not hosted"},"hosted":{"type":"boolean","title":"Hosted","description":"false when the cited document is not (yet) in the corpus -- the citation is real, the target is not held here","default":true}},"type":"object","required":["uri"],"title":"Citation","description":"One citation a document makes -- the outbound direction."},"Document":{"properties":{"uri":{"type":"string","title":"Uri","description":"the canonical uri"},"source":{"type":"string","title":"Source","description":"which corpus it comes from"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind","description":"the document kind within it"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"its printed id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"its full title"},"inbound_count":{"type":"integer","title":"Inbound Count","description":"how many catalogued documents cite it"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url","description":"the publisher's own page for the document"},"artifact":{"additionalProperties":true,"type":"object","title":"Artifact","description":"the on-disk artifact JSON, verbatim -- the same object a bulk-dump line carries, and the source of truth everything else here is derived from. Each source owns its shape, but every renderable text value is a list of inline runs: a plain string, or a link dict {predicate, uri, text}. Those link dicts are the citation graph. See the artifact-format section of docs/api/README.md."}},"type":"object","required":["uri","source","inbound_count","artifact"],"title":"Document","description":"A document: its metadata plus the parsed artifact itself."},"DocumentList":{"properties":{"total":{"type":"integer","title":"Total","description":"documents matching the filter, before paging"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"documents":{"items":{"$ref":"#/components/schemas/DocumentSummary"},"type":"array","title":"Documents"}},"type":"object","required":["total","limit","offset","documents"],"title":"DocumentList","description":"One page of the catalog enumeration."},"DocumentSummary":{"properties":{"uri":{"type":"string","title":"Uri","description":"the canonical uri -- the key for every other endpoint"},"source":{"type":"string","title":"Source","description":"which corpus it comes from"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind","description":"the document kind within it"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"its printed id (\"2018:585\")"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"its full title"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url","description":"the publisher's own page for the document (the \"Källa\" link), where one is derivable"},"updated":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated","description":"when the artifact was last built (ISO 8601 UTC). Null for a stub with no artifact of its own."}},"type":"object","required":["uri","source"],"title":"DocumentSummary","description":"A document as it appears in a listing: its id and top-level metadata,\nwithout its body. Fetch the body with /document?uri=…"},"DumpInfo":{"properties":{"source":{"type":"string","title":"Source","description":"the source the dump holds"},"file":{"type":"string","title":"File","description":"its filename, e.g. sfs.ndjson.gz"},"bytes":{"type":"integer","title":"Bytes","description":"its size on disk"}},"type":"object","required":["source","file","bytes"],"title":"DumpInfo","description":"One bulk dump. This is a manifest entry, not a download link -- the\nfiles are served beside the API at /dumps/<file>."},"FacetBucket":{"properties":{"key":{"type":"string","title":"Key","description":"the raw bucket key (\"nja\", \"2024\", \"A\")"},"label":{"type":"string","title":"Label","description":"its display label (\"NJA – Högsta domstolen\")"},"slug":{"type":"string","title":"Slug","description":"its URL path segment on the site"},"count":{"type":"integer","title":"Count","description":"documents in this bucket, children included"},"children":{"anyOf":[{"items":{"$ref":"#/components/schemas/FacetBucket"},"type":"array"},{"type":"null"}],"title":"Children","description":"the next facet level, where there is one"},"documents":{"anyOf":[{"items":{"$ref":"#/components/schemas/BrowseDoc"},"type":"array"},{"type":"null"}],"title":"Documents","description":"the leaf listing. Populated by /browse only; always null from /facets."}},"type":"object","required":["key","label","slug","count"],"title":"FacetBucket","description":"One navigation bucket: a court, a year, a subject initial. Buckets nest\nat most two levels deep."},"FacetTree":{"properties":{"source":{"type":"string","title":"Source","description":"the source asked about, echoed back"},"levels":{"items":{"type":"string"},"type":"array","title":"Levels","description":"the facet axis names, outer first (e.g. [\"court\", \"year\"])"},"default":{"items":{"type":"string"},"type":"array","title":"Default","description":"the landing bucket's key path"},"buckets":{"items":{"$ref":"#/components/schemas/FacetBucket"},"type":"array","title":"Buckets"}},"type":"object","required":["source","levels","default","buckets"],"title":"FacetTree","description":"A source's whole navigation model: which axes it is filed by, where a\nreader lands, and the buckets themselves."},"Fragment":{"properties":{"uri":{"type":"string","title":"Uri","description":"the fragment uri, e.g. https://lagen.nu/1975:635#P6"},"pinpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pinpoint","description":"the anchor within the document (\"P6\", \"K4P7\", \"A32\") -- the part after the #"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"what names this place: the pinpoint written the way a reader cites it (\"4 kap. 4 §\", \"artikel 32\"), or -- where the anchor has no citation grammar, as a förarbete's \"sec745\" has none -- the heading the document prints over that section. Null where there is neither."},"highlight":{"items":{"type":"string"},"type":"array","title":"Highlight","description":"query matches in this passage, as HTML with the matched terms in <em>","default":[]}},"type":"object","required":["uri"],"title":"Fragment","description":"A place *inside* a document: the uri plus what to call it. Follow it as\n`SearchResult.url + \"#\" + pinpoint`."},"GraphInternal":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/GraphUnit"},"type":"array","title":"Nodes"},"edges":{"items":{"prefixItems":[{"type":"string"},{"type":"string"},{"type":"integer"}],"type":"array","maxItems":3,"minItems":3},"type":"array","title":"Edges","description":"(citing unit anchor, cited unit anchor, links)"},"truncated":{"type":"integer","title":"Truncated","description":"unit pairs left out by the edge cap"}},"type":"object","required":["nodes","edges","truncated"],"title":"GraphInternal","description":"The document citing itself: which of its provisions cite which. Only\nanswered for a fragment uri."},"GraphNeighbor":{"properties":{"uri":{"type":"string","title":"Uri","description":"the neighbour's canonical uri"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"its printed id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"its title"},"descriptive":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Descriptive","description":"the compact citing form -- what to print on the node (\"NJA 2015 s. 1\", \"Räntelagen\")"},"source":{"type":"string","title":"Source","description":"its corpus"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind","description":"its document kind"},"group":{"type":"string","title":"Group","description":"the flow group it belongs to (\"Författningar\", \"Rättsfall\", …) -- the same names ?groups= filters on"},"n":{"type":"integer","title":"N","description":"links between the two documents"}},"type":"object","required":["uri","source","group","n"],"title":"GraphNeighbor","description":"One document on the other end of the citation relation, with the two\ndocuments' links between them counted into one row."},"GraphResponse":{"properties":{"uri":{"type":"string","title":"Uri","description":"the uri asked about, echoed back"},"root":{"type":"string","title":"Root","description":"`uri` without its fragment -- the document"},"anchor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anchor","description":"the fragment as asked, if any"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit","description":"the pinpointable unit that anchor belongs to (an anchor inside a stycke answers for its paragraf)"},"pinpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pinpoint","description":"that unit's reader form (\"4 kap. 7 §\")"},"descriptive":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Descriptive","description":"the compact citing name of the document"},"citation":{"type":"string","title":"Citation","description":"the whole node written as a citation (\"Artikel 6 EKMR\")"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"the document's printed id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"its title"},"source":{"type":"string","title":"Source","description":"its corpus"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind","description":"its document kind"},"group":{"type":"string","title":"Group","description":"the flow group it belongs to"},"inbound":{"anyOf":[{"$ref":"#/components/schemas/GraphSide"},{"type":"null"}],"description":"who cites this node; null when ?direction= excluded it"},"outbound":{"anyOf":[{"$ref":"#/components/schemas/GraphSide"},{"type":"null"}],"description":"what this node cites; null when ?direction= excluded it"},"internal":{"anyOf":[{"$ref":"#/components/schemas/GraphInternal"},{"type":"null"}],"description":"the document's own provision-to-provision graph. Only for a fragment uri."}},"type":"object","required":["uri","root","citation","source","group"],"title":"GraphResponse","description":"One node's neighbourhood in the citation graph, aggregated per neighbour\ndocument and ready to draw."},"GraphSide":{"properties":{"total_links":{"type":"integer","title":"Total Links","description":"links on this side, over the resolved and group-filtered set"},"total_docs":{"type":"integer","title":"Total Docs","description":"distinct documents on this side"},"unresolved":{"type":"integer","title":"Unresolved","description":"outbound only: citations whose target is not in the corpus, so they have no neighbour row","default":0},"top":{"items":{"$ref":"#/components/schemas/GraphNeighbor"},"type":"array","title":"Top"}},"type":"object","required":["total_links","total_docs","top"],"title":"GraphSide","description":"One direction of the neighbourhood. `top` is the `limit` biggest\nneighbours; the totals describe the whole side."},"GraphUnit":{"properties":{"anchor":{"type":"string","title":"Anchor","description":"the unit's fragment id (\"K4P7\", \"A6\")"},"label":{"type":"string","title":"Label","description":"its reader form (\"4 kap. 7 §\")"},"n":{"type":"integer","title":"N","description":"internal links touching the unit"}},"type":"object","required":["anchor","label","n"],"title":"GraphUnit","description":"One provision of the document, as a node of its internal graph."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InboundCitation":{"properties":{"uri":{"type":"string","title":"Uri","description":"the citing document"},"target":{"type":"string","title":"Target","description":"what it cited: the queried uri or a fragment of it"},"anchor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anchor","description":"where in the citing document the citation sits"},"page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page","description":"the printed page it sits on, where the citing document has pages (förarbeten, föreskrifter, avgöranden)"},"predicate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Predicate","description":"the relation, when it is a typed one (rpubl:bemyndigande, rpubl:andrar, rpubl:upphaver)"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"the citing document's printed id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"its title"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"its corpus"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind","description":"its document kind"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date","description":"its date (ISO 8601), where the source records one"},"inbound_count":{"type":"integer","title":"Inbound Count","description":"how many documents cite the *citing* document -- its own authority signal, so a caller can rank \"the leading cases on this paragraf\" without a lookup per row. Same number and same name as /search and /document answer with. It is how often a document is cited, which correlates with authority but is not the same thing: it favours an old case over a recent one, and it can only count what this corpus holds. Order by it with ?sort=citations."}},"type":"object","required":["uri","target","inbound_count"],"title":"InboundCitation","description":"One citation *into* a document. Distinct from `Citation` because the\ninbound direction has a field the outbound one cannot have: `target`, the\nprovision the citation landed on, which is the whole answer when the query\nwas a law rather than a paragraf. `hosted` has no inbound counterpart -- a\nciter is a catalogued document or it would not be here."},"InboundCitations":{"properties":{"uri":{"type":"string","title":"Uri","description":"the uri asked about, echoed back"},"scope":{"type":"string","title":"Scope","description":"the scope asked for, echoed back"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"the citing-side filter, echoed back"},"sort":{"type":"string","title":"Sort","description":"the order asked for, echoed back"},"total":{"type":"integer","title":"Total","description":"rows matching the scope and filter, before paging"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"by_source":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Source","description":"{source: rows} over the whole scope, not the page -- so a client that took the first 10 000 of brottsbalken's 162 909 can still see what the rest is made of, and page towards it, instead of inferring the corpus from a slice"},"citations":{"items":{"$ref":"#/components/schemas/InboundCitation"},"type":"array","title":"Citations"}},"type":"object","required":["uri","scope","sort","total","limit","offset","by_source","citations"],"title":"InboundCitations","description":"Who cites a document. One row per (citing document, citing spot,\nprovision cited) -- unreduced, so a document that cites the same provision\nfive times is five rows."},"MarkdownDocument":{"properties":{"uri":{"type":"string","title":"Uri","description":"the canonical uri"},"source":{"type":"string","title":"Source","description":"which corpus it comes from"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind","description":"the document kind within it"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"its printed id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"its full title"},"inbound_count":{"type":"integer","title":"Inbound Count","description":"how many catalogued documents cite it"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url","description":"the publisher's own page for the document"},"markdown":{"type":"string","title":"Markdown","description":"the document body as markdown: title, headings, paragraph designations, lists and tables, with every citation as an inline [text](uri) link. A lossy reading text derived from the artifact -- the artifact (format=json) stays the source of truth."}},"type":"object","required":["uri","source","inbound_count","markdown"],"title":"MarkdownDocument","description":"A document: its metadata plus the body rendered as markdown."},"SearchFacetBucket":{"properties":{"value":{"type":"string","title":"Value","description":"the raw facet value (\"sfs\", \"bet\", \"2024\")"},"count":{"type":"integer","title":"Count","description":"hits with this value, counted against the *other* selected filters -- so the number stays usable for widening the search"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"the reader-facing name for `value`, from the same facet schemes the browse pages use. Null when the value is its own label, as a year is."}},"type":"object","required":["value","count"],"title":"SearchFacetBucket","description":"One value of one facet, with how many hits carry it. Render\n`label or value`."},"SearchResponse":{"properties":{"query":{"type":"string","title":"Query","description":"the query as asked, echoed back"},"total":{"type":"integer","title":"Total","description":"matching documents, before paging"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"opaque cursor for the next page; null once the last page is reached"},"facets":{"additionalProperties":{"items":{"$ref":"#/components/schemas/SearchFacetBucket"},"type":"array"},"type":"object","title":"Facets","description":"bucket counts per facet field (source, kind, year)","default":{}},"results":{"items":{"$ref":"#/components/schemas/SearchResult"},"type":"array","title":"Results"}},"type":"object","required":["query","total","results"],"title":"SearchResponse","description":"The answer to /search. Page it with `next_cursor`; `offset` is the\nbounded random-access alternative."},"SearchResult":{"properties":{"uri":{"type":"string","title":"Uri","description":"the document's canonical uri -- its id everywhere: this API's ?uri=, the dump line, the search index _id"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"the public page path (/1975:635, /dom/nja/2015s1). Null for a document the site does not host a page for."},"identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Identifier","description":"the document's own printed id (\"1975:635\", \"NJA 2015 s. 1\")"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"its full title"},"display":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display","description":"the reader-facing heading: the short name plus its acronym where there is one, else the title"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"which corpus it comes from (sfs, dv, forarbete, …)"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind","description":"the document kind within that source (lag, forordning, case, prop, …)"},"kind_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind Label","description":"what `kind` is called to a reader (\"Lagrådsremiss\", \"Betänkande\"). A hit whose identifier is its own title -- every förarbete published without a series number -- has nothing else to say what sort of document it is."},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score","description":"relevance, combining text match with citation count. Null for a pinned hit, which was resolved rather than ranked."},"inbound_count":{"type":"integer","title":"Inbound Count","description":"how many catalogued documents cite this one -- the same graph /document/inbound serves in full","default":0},"highlight":{"items":{"type":"string"},"type":"array","title":"Highlight","description":"the document's own snippet: what this hit is about. Always the document's, never a passage's.","default":[]},"pin":{"anyOf":[{"$ref":"#/components/schemas/Fragment"},{"type":"null"}],"description":"the provision a citation-shaped query resolved to (\"avtalslagen 36 §\"). The one thing that moves the link off the document: follow `url + \"#\" + pin.pinpoint` when a pin is set, and `url` otherwise."},"fragments":{"items":{"$ref":"#/components/schemas/Fragment"},"type":"array","title":"Fragments","description":"the passages inside this document where the query matched, most relevant first. Supporting detail to show under the hit -- never its link target, since a word can stand in a document for reasons that are not what the reader asked for (\"dataförordningen\" stands in article 47 of the EU Data Act because that article amends another regulation by quoting its title).","default":[]}},"type":"object","required":["uri"],"title":"SearchResult","description":"One hit. `url` is where to send a reader, unless `pin` is set -- then it\nis `url + \"#\" + pin.pinpoint`."},"SourceInfo":{"properties":{"source":{"type":"string","title":"Source","description":"the source name, as every ?source= parameter takes it"},"documents":{"type":"integer","title":"Documents","description":"catalogued documents in it"}},"type":"object","required":["source","documents"],"title":"SourceInfo","description":"One corpus and how much of it there is."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VersionInfo":{"properties":{"version":{"type":"string","title":"Version","description":"the consolidation cutoff -- the SFS number of the amendment this text includes (\"2003:466\"). Pass it as ?from= / ?to= to /diff."},"uri":{"type":"string","title":"Uri","description":"the version's own canonical uri"},"url":{"type":"string","title":"Url","description":"its hosted page (/1998:204/konsolidering/2003:466)"},"ikraft":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ikraft","description":"when the cutoff amendment entered force (ISO 8601). Null where the statute's register does not say."},"forarbeten":{"items":{"type":"string"},"type":"array","title":"Forarbeten","description":"the amendment's preparatory works, as printed (\"Prop. 1997/98:44\")","default":[]}},"type":"object","required":["version","uri","url"],"title":"VersionInfo","description":"One archived consolidation (lydelse) of a statute: the text as it stood\nafter a named amendment, before the next one."},"VersionList":{"properties":{"uri":{"type":"string","title":"Uri","description":"the statute asked about, echoed back"},"versions":{"items":{"$ref":"#/components/schemas/VersionInfo"},"type":"array","title":"Versions","description":"oldest first. The current consolidation is excluded -- it is what /document returns."}},"type":"object","required":["uri","versions"],"title":"VersionList","description":"A statute's version history."}}},"tags":[{"name":"search","description":"Full text plus citation resolution. One endpoint; the ⌘K palette uses no other."},{"name":"catalog","description":"What the corpus holds: sources, navigation facets and the bulk-dump manifest."},{"name":"document","description":"One document: its parsed body, its citations in both directions, its versions, and its pages as images or PDF."}]}