Skip to main content

Get document

Retrieve a single regulatory document by its unique ID. Returns the full document content, metadata, classification fields, and any related document references.

Endpoint

GET https://service.betterregulation.com/api/document/{documentId}?access_token=[your-api-key]

Example request

https://service.betterregulation.com/api/document/38001?access_token=[your-api-key]

Each document also has a human-readable URL for viewing in the browser:

https://service.betterregulation.com/document/38001
Finding a document ID: Document IDs appear in the URL when viewing any document on Better Regulation. They are also returned in search results via the field_doc_docid field.

Versioned documents

Some documents have multiple versions reflecting changes over time. By default, the API returns the latest version. To request the version that was in effect on a specific date, append the date to the path.

https://service.betterregulation.com/api/document/38001/2012/07/11?access_token=[your-api-key]
Date format: Dates must be provided in YYYY/MM/DD format. Use the field_tm_from and field_tm_to values from a previous response to identify valid version date ranges.

Response

The response is returned as JSON. The data array contains a single document object with all fields for the requested document.

Fields with no value return false, not null. When checking relationship fields or optional metadata, test for false rather than null in your integration.
Date fields (field_tm_from, field_tm_to) are returned as Unix timestamps, not formatted dates. Convert to a readable date in your application as needed. For example, 1348614000 corresponds to 25 September 2012.

Download list of data terms & IDs

Example response

{"data":[
  {"document":
    {"root_or_spd":"no",
    "book_hierarchy":["Dormant Accounts (Amendment) Act 2012 (No. 23)"],
    "url":"https:\/\/service.betterregulation.com\/document\/38001",
    "nid":"80540",
    "title":"5. Dissolution of Dormant Accounts Board.",
    "body":"...",
    "field_news_date":false,
    "field_doc_organisation":["Legislation (IE)"],
    "field_doc_doctype":{"204":"Acts"},
    "field_doc_docyear":{"357":"2012"},
    "field_doc_jurisdiction":{"30":"Ireland"},
    "field_doc_area":{"95":"Irish Financial Services Law"},
    "field_doc_docsubject":{"130":"Banks\/Credit Institutions"},
    "field_doc_docno":["23"],
    "field_doc_docid":"38001",
    "field_doc_source_url":false,
    "field_tm_from":"1348614000",
    "field_tm_to":false,
    "field_doc_pagestatus":{"562":"In force"},
    "future_version":"no",
    "latest_version":"yes",
    "version_number":2,
    ...
    }
  }],
  "self":{"title":"Self",
  "href":"https:\/\/service.betterregulation.com\/api\/v1.0\/document\/38001"
  }
}
The body field contains escaped HTML. The full document text is returned as an HTML string with escaped characters (e.g. &lt; represents <). You will need to unescape this before rendering it.

Response properties

Taxonomy and entity reference fields return an object with the term ID as the key and the term name as the value — for example, {"204": "Acts"}. Use the Search Term IDs page for a full list of valid IDs and names.

Field Type Description
url Link Human-readable URL of the document on Better Regulation.
nid Integer Node ID — the internal identifier assigned to all content nodes within Better Regulation. Not the same as field_doc_docid.
field_doc_docid Integer The document ID used to retrieve this document via the API.
field_doc_defid Integer Identifier assigned to definitions within Better Regulation.
root_or_spd Boolean Indicates whether this page is the root of a book-structured document or a single-page document (SPD).
book_hierarchy Array The parent document hierarchy for book-structured documents, listed from root to current page.
title String Title of the document node.
body String Full HTML content of the document, returned as an escaped string.
field_news_date Date The date the document was added to the Better Regulation database. Returns false if not set.
field_tm_from Unix timestamp The start date of this version of the document.
field_tm_to Unix timestamp The end date of this version. Returns false if this is the current version with no end date.
latest_version String Returns "yes" if this is the current version of the document as of today.
future_version String Returns "yes" if this version has a field_tm_from date in the future.
version_number Integer The version number of this document node.
field_doc_pagestatus Term reference Current page status (e.g. In force, Repealed). Returns a {tid: name} object.
field_doc_organisation Entity reference The organisation that originally published the document.
field_doc_doctype Term reference Document type classification (e.g. Acts, EU Directives).
field_doc_docyear Term reference Year the document was originally published.
field_doc_docno Text Publication number, if one exists.
field_doc_jurisdiction Term reference Jurisdiction(s) the document applies to.
field_doc_area Term reference Primary module area classification within Better Regulation.
field_doc_docsubject Term reference Secondary subject classification within Better Regulation.
field_doc_consolidationtax Term reference Consolidation status of the document.
field_doc_sanctions_country Term reference Sanctioned country or regime the document relates to, if applicable.
field_doc_source_url Link URL of the original source document. Returns false if not available.
field_retained_eu_law_appropriat Entity reference Relevant organisation reference for retained EU law documents.
field_rel_reg_tech_stand Entity reference Related Regulatory Technical Standards, if applicable.
field_rel_imple_tech Entity reference Related Implementing Technical Standards, if applicable.
field_rel_decision Entity reference Related Decision, if applicable.
field_rel_gui Entity reference Related Guidelines, if applicable.
field_rel_qa Entity reference Related Q&A documents, if applicable.
field_trans_act Entity reference Related Transposing Act, if applicable.
field_trans_statu_inst Entity reference Related Transposing Statutory Instrument, if applicable.
field_rel_bill_history Entity reference Related Bill, if applicable.
field_rel_ucits_notice Entity reference Related UCITS Notice, if applicable.
field_rel_option_discre Entity reference Related Opinions & Discretions, if applicable.
field_rel_adopted_published_oj Entity reference Related documents adopted and published in the Official Journal, if applicable.
field_rel_delegated_act Entity reference Related Delegated Act, if applicable.
field_rel_implementing_act Entity reference Related Implementing Act, if applicable.
field_rel_press_release Entity reference Related Press Release, if applicable.
field_rel_opinion Entity reference Related Opinion, if applicable.
field_comm_order_for Entity reference Related Commencement Order, if applicable.
field_reg_made_under Entity reference Related Regulations Made Under, if applicable.