Nimble
Prepared for Thomson Reuters

Extraction Templates for CoCounsel

CoCounsel retrieves from official legal sites one stage at a time, and every stage is one template call. The output of each call supplies the inputs of the next. Two examples run from the search term to the case law, one in the United Kingdom and one in Germany.

Explanation

CoCounsel runs the orchestration and Nimble supplies the templates

CoCounsel calls Nimble one stage at a time. After each call, it reviews what came back and keeps the relevant results. It then sends their ids to the next stage, or it stops.

An Extraction Template is an API call that Nimble builds for one kind of page on one trusted site. CoCounsel sends a keyword or a document reference, and the template returns named fields, so there is no web page to parse.
The four stages, with the United Kingdom example
Returns

Every Act that matches the words, 20 per page. Each Act comes with its title, citation, type_code, year and number.

“unfair dismissal” returns 86 Acts.

CoCounsel reviews and decides

Stops when the Act titles answer the question.

Keeps the Acts that matter. Here it keeps the Employment Rights Act 1996.

Passes to stage 2
type_code: "ukpga"year: "1996"number: "18"text: "unfairly dismissed"
Returns

Every section of the Act that uses a phrase, with its section number, title and URL.

“unfairly dismissed” returns 33 sections.

CoCounsel reviews and decides

Stops when the section titles are enough.

Keeps the sections that matter. Here it keeps section 94, “The right.”

In Germany the site search already returns provisions, so CoCounsel skips this stage.

Passes to stage 3
type_code: "ukpga"year: "1996"number: "18"section: "94"
3

Fetch the provision

uk_legislation_section
Returns

The current text of the section as named fields: the title, each subsection, the subsection numbers and the extent.

Section 94 returns 2 subsections in 637 characters.

CoCounsel reviews and decides

Stops and cites the text when the lawyer only needs the rule.

Goes on to the case law when the lawyer needs the judgments that apply it.

Passes to stage 4
query: "section 94" "Employment Rights Act 1996"
Returns

Every judgment that cites the section, 10 per page, with name, court, citation, date, snippets and URL. A second template returns one judgment as numbered paragraphs.

Section 94 returns 86 judgments.

CoCounsel reviews and decides

Keeps the judgments that fit the facts. Here it keeps N Stubbs v Grafters Ltd and fetches it with its path.

Passes to the judgment template
path: "eat/2022/134"

CoCounsel cites the judgment by paragraph number.

CoCounsel can keep several results at any stage. It sends one call per result it keeps, or one batch call for all of them.
A known citation skips the first stages. When the lawyer names the section, CoCounsel starts at stage 3.
Fewer tokens per answer

CoCounsel reads only what each stage returns. It never has to load the whole page of a long Act into the model.

Whole s.94 page, through Extract45,558 characters · about 11,400 tokens
Fields from the section template637 characters · about 160 tokens
Subsection (1) alone76 characters · about 20 tokens

Section 94 of the Employment Rights Act 1996, measured on live runs on 11 October 2026. Tokens are estimated at about 4 characters each.

The templates per site

Each template name opens that template in your Nimble account. Nimble builds templates for another approved site on request.

Calling a template

Every template uses the same endpoint. The template name and its parameters go in the body, and the result is in data.parsing.

curl -s -X POST https://sdk.nimbleway.com/v2/extract/templates/run \
  -H "Authorization: Bearer $NIMBLE_API_KEY" -H "Content-Type: application/json" \
  -d '{"template": "<name>", "params": {...}}'

For the full text of any URL or PDF, CoCounsel calls Extract. Batch mode takes up to 1,000 URLs in one call.

Examples

Each stage shows the page, the call and what came back

Use case
A lawyer needs the statutory right not to be unfairly dismissed, its current text and the judgments that apply it.
Sources
legislation.gov.uk for the Act and the section. Find Case Law, from The National Archives, for the judgments.
Route
Five template calls, from the search term to one judgment.
1

Find the Act uk_legislation_search

search for “unfair dismissal”, 86 Acts
legislation.gov.uk search for “unfair dismissal”, 86 Acts
Call
-d '{"template":"uk_legislation_search","params":{"text":"unfair%20dismissal","page":"1"}}'
Returns

title, citation, type_code, year, number, contents_url, rank for each Act, 20 per page. The template runs the site's own search. The type_code, year and number go straight into the next call.

Result

20 Acts on page 1. First four:

RankActtype_code · year · number
1Trade Union and Labour Relations (Consolidation) Act 1992ukpga · 1992 · 52
2Employment Rights Act 1996ukpga · 1996 · 18
3Employment Protection (Consolidation) Act 1978ukpga · 1978 · 44
4Employment Rights Act 2025ukpga · 2025 · 36
2

Find the sections uk_legislation_contents_matches

contents of the Employment Rights Act 1996, matching sections highlighted
legislation.gov.uk contents of the Employment Rights Act 1996, matching sections highlighted
Call
-d '{"template":"uk_legislation_contents_matches","params":{"type_code":"ukpga","year":"1996","number":"18","text":"unfairly%20dismissed"}}'
Returns

the sections whose text contains the phrase: section, title, section_url. The Act's ids come from stage 1. The match is literal. Section 94 reads “unfairly dismissed”, so CoCounsel uses that phrase.

Result
SectionTitle
43KAApplication of this Part and related provisions to police
94The right.
98BJury service
99Leave for family reasons.
100Health and safety cases.
…33 sections in all
3

Fetch a section uk_legislation_section

section 94, latest available version
legislation.gov.uk section 94, latest available version
Call
-d '{"template":"uk_legislation_section","params":{"type_code":"ukpga","year":"1996","number":"18","section":"94"}}'
Returns

The template returns section_title, paragraphs[], subsection_numbers[], extent. The text keeps the site's amendment markers, such as F1 and M1.

Result

s.94 The right.

(1) An employee has the right not to be unfairly dismissed by his employer.

(2) Subsection (1) has effect subject to the following provisions of this Part (in particular sections 108 to 110) and to the provisions of the Trade Union and Labour Relations (Consolidation) Act 1992 (in particular sections 237 to 239).

4

Case law on the section uk_caselaw_search

search for “section 94” “Employment Rights Act 1996”
Find Case Law search for “section 94” “Employment Rights Act 1996”
Call
-d '{"template":"uk_caselaw_search","params":{"query":"%22section+94%22+%22Employment+Rights+Act+1996%22"}}'
Returns

total_results and 10 judgments per page: name, court, neutral_citation, handed_down, snippets[], judgment_url. Find Case Law holds judgments from 2001 and is complete from 2022.

Result

86 results. Four of page 1:

#NameNeutral citationHanded down
1Clyde & Co LLP & Anor v Bates Van Winkelhof[2012] EWCA Civ 12072012-09-26
2Hottak & Anor v Secretary of State for Foreign and Commonwealth Affairs[2015] EWHC 1953 (Admin)2015-07-08
3Creditsights Ltd v Dhunna[2014] EWCA Civ 12382014-09-19
7N Stubbs v Grafters Ltd[2022] EAT 1342022-05-31
5

Fetch a judgment uk_caselaw_judgment

N Stubbs v Grafters Ltd [2022] EAT 134
Find Case Law N Stubbs v Grafters Ltd [2022] EAT 134
Call
-d '{"template":"uk_caselaw_judgment","params":{"path":"eat/2022/134"}}'
Returns

case_name, neutral_citation, paragraphs[]. Each paragraph has a number and texts[]. CoCounsel picks the judgment ranked 7th and sends its judgment_url without the domain.

Result

The judgment N Stubbs v Grafters Ltd [2022] EAT 134 has 18 paragraphs.

1. This is an appeal against the decision of Employment Judge Cadney on 21st October 2021 striking out the appellant’s claim. That strike-out was the subject of a review by EJ Midgley on 29th October 2021, who did not reverse the decision.

Use case
A lawyer needs the rule on Störung der Geschäftsgrundlage (§ 313 BGB), its current text and the decisions that cite it.
Sources
gesetze-im-internet.de for the provision. dejure.org for the decisions that cite it.
Route
Three template calls, from the search term to the decisions that cite § 313.
1

Find the provision germany_gesetze_im_internet_fulltext_search

Volltextsuche for “Störung Geschäftsgrundlage”
gesetze-im-internet.de Volltextsuche for “Störung Geschäftsgrundlage”
Call
-d '{"template":"germany_gesetze_im_internet_fulltext_search","params":{"words":"St%F6rung+Gesch%E4ftsgrundlage"}}'
Returns

total_hits and up to 50 provisions: label, url, instrument, section, snippet, stars, the site's rating from 1 to 4. The words are Latin-1 encoded (ä is %E4, ö is %F6) and joined with +. This search returns provisions, so CoCounsel skips the contents stage.

Result

3 hits

LabelURLStars
§ 313 BGB - Einzelnormgesetze-im-internet.de/bgb/__313.html4
BGB - nichtamtliches Inhaltsverzeichnisgesetze-im-internet.de/bgb/1
§ 17 BwBBG - Einzelnormgesetze-im-internet.de/bwbbg_2026/__17.html1
2

Fetch the provision germany_gesetze_im_internet_provision

§ 313 BGB
gesetze-im-internet.de § 313 BGB
Call
-d '{"template":"germany_gesetze_im_internet_provision","params":{"instrument_slug":"bgb","section_id":"313"}}'
Returns

The template returns 12 fields, including section_label, section_title, paragraphs[], cross_references[], text_full, url. The url from stage 1 gives the inputs (bgb/__313.html).

Result

§ 313 BGB Störung der Geschäftsgrundlage

(1) Haben sich Umstände, die zur Grundlage des Vertrags geworden sind, nach Vertragsschluss schwerwiegend verändert und hätten die Parteien den Vertrag nicht oder mit anderem Inhalt geschlossen, wenn sie diese Veränderung vorausgesehen hätten, so kann Anpassung des Vertrags verlangt werden …

(2) Einer Veränderung der Umstände steht es gleich, wenn wesentliche Vorstellungen, die zur Grundlage des Vertrags geworden sind, sich als falsch herausstellen.

3

Case law on the provision germany_dejure_provision_caselaw

Rechtsprechung zu § 313 BGB
dejure.org Rechtsprechung zu § 313 BGB
Call
-d '{"template":"germany_dejure_provision_caselaw","params":{"gesetz":"BGB","paragraf":"313","page":"1"}}'
Returns

total_decisions, pages and up to 50 decisions per page: court, date, aktenzeichen, holding, related[], dejure_url. Each dejure_url links to the decision and its full-text sources.

Result

4,054 decisions over 82 pages. First four:

CourtDateAktenzeichenHolding
OLG Hamm05.10.20262 VKl 2/23Preiserhöhungsverlangen, Verbraucherklage, Energieversorger, Ukraine
BGH15.07.2026XII ZR 7/24Geschäftsschließung wegen Corona-Pandemie: Anspruch auf Vertragsanpassung
BGH23.11.2022XII ZR 96/21Coronabedingte Schließung: Wie erfolgt Vertragsanpassung bei Gewerberaummiete?
BGH11.10.2023XII ZR 87/22Vermietung einer Segelyacht während der im Vertragszeitraum geltenden …
Results

Every call on this page, as run on 11 October 2026

ExampleCallTimeResult
United Kingdomuk_legislation_search2.2 s20 Acts on page 1, Employment Rights Act 1996 second
uk_legislation_contents_matches1.7 s33 sections
uk_legislation_section s.947.8 s2 subsections
uk_caselaw_search2.8 s86 results
uk_caselaw_judgment eat/2022/1341.9 s18 paragraphs
Germanygermany_gesetze_im_internet_fulltext_search1.9 s3 hits, § 313 BGB first
germany_gesetze_im_internet_provision § 3133.9 s12 fields, 3 paragraphs
germany_dejure_provision_caselaw § 3135.1 s4,054 decisions on 82 pages
ExtractExtract on the s.94 page, for the token comparison11.2 s45,558 characters of markdown

Texts were compared with the source pages. Provision texts match the page word for word on every tested provision: 5 in the United Kingdom and 5 in Germany. Judgment paragraphs match on the 3 judgments tested.