• Register

Reference API - Search

Search API - V1.0

Published Date: 07/12/2023

In this article

Overview

The Reference API facilitates using the Search API, a capability within Compliance.ai that empowers users to find documents on the platform. This Search API allows users to efficiently retrieve relevant documents by applying specific search criteria, simplifying the process of accessing necessary information from the platform.

To explore and utilize this API, refer to the detailed documentation available at: https://developer.compliance.ai/io-docs. This resource offers comprehensive information and guidance on effectively utilizing the Search API.

Endpoints

Top Level API Path

https://api.compliance.ai/v1/

GET Search Documents

The GET Search Documents endpoint retrieves relevant documents based on the provided query. When including agency, jurisdiction, and news source parameters, the search operates on an OR statement, including documents that match any of those values. To input multiple values, use the advanced_search parameter or manually update the request URL with attribute=1&attribute=2&attribute=3. This endpoint offers flexible searching for users to find the documents they need by using the following parameters:

Field Description Type
doc_ids Represents a valid Compliance.ai document ID. If other parameters are included, the results will be based on all submitted parameters.  integer
doc_id Represents a valid Compliance.ai document ID. This attribute is being phased out and replaced by doc_ids. integer
resource_id Represents a valid Compliance.ai document resource ID. If doc_id is not provided, all other parameters will be ignored, and the call will return one document based on the specified resource ID.  integer
more_like_doc_id Returns three documents similar to the provided doc_id.  integer
get_count_only Returns only the count of documents found in the search. Use 'true' to show the count; otherwise, leave it blank. bool
query Allows a bag-of-words search with boolean search terms. By default, the call returns the latest documents for the query term. String
advanced_search Allows building a query with advanced search operators that require the correct sequence of attributes, comparators, and values. It can be used alone or combined with other parameters. More info String
topic_id Returns documents based on an available topic. List integer
topic_threshold_key Returns documents based on the selected threshold for topics. Thresholds available are low, medium, and high. query
regulation_id Returns documents based on a specific regulation. List integer
agency_id Limits the query to documents from a specific agency. List integer
skip_agency Skips documents published by a specific agency. integer
all_agencies Returns documents for all agencies in Compliance.ai. bool
category Filter based on a type of document. List string
cai_category Filters documents based on a type of document. integer
cai_metacategories Filters documents based on a meta category of document. integer
skip_category Skips documents under a specific category. List string
bank_id Returns documents associated with a bank ID. List integer
citation_id Returns documents associated with a citation ID. integer
docket_id Returns documents in a docket. integer
act_id Returns documents based on a query for an act ID.List integer
jurisdiction Returns documents published by a jurisdiction. List integer
news_source_id Returns documents published by a specific news source. List integer
accept-encoding Specifies the response format as JSON. -
publication_date Filters documents by publication date. string
published_from Filters documents by published_from date, format MM/DD/YYYY. string
published_to Filters documents by published_to date, format MM/DD/YYYY. string
key_date_from Filters documents that have a comments_close_from OR compliance_from date from a specific date forward.  string
key_date_to Filters documents that have a comments_close_to or a compliance_to date up until a specific date. string
comments_close_date Returns documents that have a comments close date from a specific date. This can be used with specific relative dates like 'Today', 'Tomorrow', 'Yesterday'. or with a range of relative dates like 'within 30 days' by using the value '[x]:[days/weeks/months/years]'. string
comments_close_from Returns documents that have a comments close date from a specific date forward. string
comments_close_to Returns documents that have a comments close date up until a specific date. string
compliance_date Returns documents that were effective from a specific date. This can be used with specific relative dates like 'Today', 'Tomorrow', 'Yesterday', or with a range of relative dates like 'within 30 days' by using the value '[x]:[days/weeks/months/years]'. string
compliance_from Returns documents that were effective from a specific date forward.  string
compliance_to Returns documents that were effective up until a specific date.  string
created_date Returns documents that were created in the system from a specific date. This can be used with specific relative dates like 'Today', 'Tomorrow', 'Yesterday', or with a range of relative dates like 'within 30 days' by using the value '[x]:[days/weeks/months/years]'. string
created_from Returns documents that were created in the system from a specific date forward. string
created_to Returns documents that were created in the system up until a specific date.  string
updated_date Returns documents that were updated in the system from a specific date. This can be used with specific relative dates like 'Today', 'Tomorrow', 'Yesterday', or with a range of relative dates like 'within 30 days' by using the value '[x]:[days/weeks/months/years]'. string
updated_from Returns documents that were updated in the system from a specific date forward.  string
updated_to Returns documents updated up until a specific date. -
monetary_penalty Returns documents with the specified monetary penalty. integer
monetary_penalty_min Returns documents with a monetary penalty greater than the specified value.  integer
monetary_penalty_max Returns documents with a monetary penalty less than the specified value.  integer
min_score Returns documents with a search relevance score above the specified value. Range: 1-100.  integer
offset Returns a subset of search results by skipping the specified number of documents.  integer
order Specifies the sorting order of the search results.  -
sort Sorts documents by the specified field. Choose from 'category', 'id', or 'publication_date'.  -
limit Limits the number of documents returned. integer
exclusive_fields Returns only the specified attributes and sub-attributes in the document JSON response. string
folder_id Returns only documents that belong to the specified user-created folder ID. integer
task_owner Returns documents with workflow tasks associated with the 'current_user' or 'organization'. Any other input value returns an error. string
title Returns documents published with the specified search terms in the title. string
text Returns documents published with the specified search terms in the full text of the document. string
formatted_full_text Returns the formatted full text attribute for documents that have available sentences. bool
has_obligations Returns documents that have available obligations. Use 'true' to show documents with obligations, leave blank otherwise. Note: Ignore the 'has_obligation' field in the results as it is not currently used. The 'obligation_probability' field is used to determine if a document has obligations. bool
has_sentences Returns documents with text split into separate sentences. Use 'true' to show documents with sentences, leave blank otherwise. bool

Sample Request URI

https://api.compliance.ai/v1/search?doc_id=12818675&order=desc&limit=10&formatted_full_text=true&api_key=YOURKEY

Sample Response

{
    "count": 1,
    "documents": [{
        "agencies": [{
            "id": 2000002,
            "jurisdiction": "US-TN",
            "jurisdiction_id": 47,
            "name": "Tennessee General Assembly",
            "short_name": "TN-GA"
        }],
        "agency_ids": [
        2000002],
        "alt_summaries": [],
        "bookmarked": false,
        "cai_category_id": 3936,
        "cai_category_name": "Act",
        "category": "Act ",
        "cfr_parts": [],
        "children": [],
        "cited_associations": {
            "act_ids": [],
            "bank_ids": [],
            "citation_ids": [],
            "concept_ids": [],
            "named_regulation_ids": []
        },
        "clean_citations": [],
        "complianceai_id": "CAI-US-TN-TN-GA-12818675",
        "concept_tags": [],
        "created_at": "2023-05-17T16:13:59.976995",
        "deprecated": false,
        "docket_ids": ["US-TN 113 HB 0457"],
        "dockets": [{
            "docket_id": "US-TN 113 HB 0457"
        }],
        "document_version_latest": true,
        "flagged": null,
        "full_text": " {bullet_point}{bullet_point} ...",
        "full_text_hash": "ca56346...",
        "full_xml_hash": null,
        "has_obligations": false,
        "has_sentences": true,
        "has_unofficial_publication_date": true,
        "hidden": false,
        "id": 12818675,
        "important_dates": {},
        "incoming_citation_ids": [],
        "jurisdiction": "US-TN",
        "languages": [{
            "high_confidence": true,
            "id": 38,
            "name": "English"
        }],
        "meta_table": "agency_updates",
        "official_id": "c8b2a..",
        "parent": null,
        "pdf_hash": "41f01..",
        "pdf_url": "https://publications.tnsosfiles.com/acts/113/pub/pc0382.pdf",
        "pipeline_status": "processing_indexing",
        "provenance": "legal_api_docs",
        "publication_date": "2023-05-17T12:00:00",
        "related_documents": [{
            "related_docs": [],
            "relation_type": "organization",
            "total_count": 0
        }],
        "restriction_type": null,
        "sentence_main": {
            "current_sentence_version": 8351063,
            "prediction_annotation_types": {
                "obligation_probability": 0.9869
            },
            "sentence_data": [{
                "sentence_version": 8351063,
                "sentences": [{
                    "id": 635297279,
                    "obligation_group_id": 0,
                    "obligation_probability": 2e-05,
                    "sentence": " {bullet_point}{bullet_point} ...",
                    "sentence_para_id": 0,
                    "sentence_type": "p",
                    "strikethrough_info": []
                }, {
                    "id": 635297280,
                    "obligation_group_id": 1,
                    "obligation_probability": 4e-05,
                    "sentence": " . i~~ qt-{bullet_point}::~j~,i: 0:\".. lif,.li(E >\"'3: {~{bullet_point}~ lf!",
                    "sentence_para_id": 0,
                    "sentence_type": "p",
                    "strikethrough_info": []
                }]
            }]
        },
        "spider_name": "unified-us-tn-ga-acts",
        "summaries": [],
        "summary_text": "\u2022\u2022....",
        "times_cited": 0,
        "title": "HB 0457 - Sports - As enacted, makes changes concerning youth sports safety. - Chapter 0382",
        "topics": [],
        "translated": false,
        "updated_at": "2023-05-17T16:30:05.282089",
        "user_has_access": true,
        "web_url": "https://tnsos.org/acts/PublicActs.113.php?showall"
    }]
}

POST Search Documents

The POST Search Documents method, available at /v1/search_post, retrieves relevant documents based on the provided query. If there are no matching documents or an unaccepted parameter value is used, the query will return zero/null results. When including the agency, jurisdiction, and news source parameters, the search operates on an OR statement, including documents that match any of those values. To input multiple values for a parameter, simply provide them as comma-separated values.

Sample Request 

{
    "advanced_search": "(agency = CYM-CIMA AND cai_category IN [1071, 1238])", 
    "sort": "publication_date", 
    "limit": "2"  
}

Sample Request URI

https://api.compliance.ai/v1/search_post?api_key=YOURKEY

Sample Response 

{
    "count": 320,
    "documents": [{
        "agencies": [{
            "id": 17000001,
            "jurisdiction": "CYM",
            "jurisdiction_id": 600,
            "name": "Cayman Islands Monetary Authority",
            "short_name": "CYM-CIMA"
        }],
        "agency_ids": [
        17000001],
        "alt_summaries": [],
        "bookmarked": false,
        "cai_category_id": 4112,
        "cai_category_name": "Guidance",
        "category": "Guidance",
        "cfr_parts": [],
        "children": [],
        "cited_associations": {
            "act_ids": [],
            "bank_ids": [],
            "citation_ids": [],
            "concept_ids": [],
            "named_regulation_ids": []
        },
        "clean_citations": [],
        "complianceai_id": "CAI-CYM-CIMA-12845519",
        "concept_tags": [3,4],
        "created_at": "2023-05-30T20:15:06.811339",
        "deprecated": false,
        "docket_ids": [],
        "dockets": [],
        "document_version_latest": true,
        "flagged": null,
        "full_text": "SUMMARY OF PRIVATE SECTOR CONSULTATION AND FEEDBACK STATEMENT ....",
        "full_text_hash": "b7bc...",
        "full_xml_hash": null,
        "has_obligations": false,
        "has_sentences": true,
        "has_unofficial_publication_date": false,
        "hidden": false,
        "id": 12845519,
        "important_dates": {},
        "incoming_citation_ids": [],
        "jurisdiction": "CYM",
        "languages": [{
            "high_confidence": true,
            "id": 38,
            "name": "English"
        }],
        "meta_table": "agency_updates",
        "official_id": "05a5..",
        "parent": null,
        "pdf_hash": "37c11..",
        "pdf_url": "https://www.cima.ky/upimages/priorconsultation/ConsulationandFeedbackStatementPSA-ReinsuranceArrangement_1685475135.pdf",
        "pipeline_status": "processing_indexing",
        "provenance": "legal_api_docs",
        "publication_date": "2023-05-30T07:00:00",
        "related_documents": [{
            "related_docs": [],
            "relation_type": "organization",
            "total_count": 0
        }],
        "restriction_type": null,
        "sentence_main": {
            "current_sentence_version": 8363977,
            "prediction_annotation_types": {
                "obligation_probability": 0.99292
            },
            "sentence_data": [{
                "sentence_version": 8363977,
                "sentences": [{
                    "id": 637521820,
                    "obligation_group_id": 0,
                    "obligation_probability": 1e-05,
                    "sentence": " APPENDIX 2",
                    "sentence_para_id": 0,
                    "sentence_type": "h3",
                    "strikethrough_info": []
                }, {
                    "id": 637521999,
                    "obligation_group_id": 179,
                    "obligation_probability": 7e-05,
                    "sentence": " b) the persons, departments, or organisations responsible for conducting catastrophe modelling; and",
                    "sentence_para_id": 113,
                    "sentence_type": "h3",
                    "strikethrough_info": []
                }, {
                    "id": 637522000,
                    "obligation_group_id": 180,
                    "obligation_probability": 0.0004,
                    "sentence": " c) its risk appetite to provide clarity as to the risks that are retained by the insurer and those that are covered by reinsurance protections...\"",
                    "sentence_para_id": 114,
                    "sentence_type": "h3",
                    "strikethrough_info": []
                }]
            }]
        },
        "spider_name": "unified-cym-cima-prior-consultation",
        "summaries": [],
        "summary_text": "SUMMARY OF PRIVATE SECTOR CONSULTATION AND FEEDBACK STATEMENT Rules and Statement of Guidance - Reinsurance Arrangements No... ",
        "times_cited": 0,
        "title": "Summary of Private Sector Consultation and Feedback Statement - Reinsurance Arrangements",
        "topics": [{
            "id": 9,
            "judge_count": 0,
            "model_probability": 0.9999967813927622,
            "name": "Insurance",
            "positive_judgments": 0
        }],
        "translated": false,
        "updated_at": "2023-06-01T06:01:58.277175",
        "user_has_access": true,
        "web_url": "https://www.cima.ky/prior-consultation"
    }]
}

GET Pre-Filtered Content

This method returns content based on the alerts configured in the Compliance.ai application. Users can only access this content if their organization has been set up with a Service Connector.  Pre_filtered_content is a downloadable file that is created based on the workflows for the organization with Service Connector. 

Sample Request URI

https://api.compliance.ai/v1/pre_filtered_content?api_key=YOURKEY

Sample Response

{
    "count": 1005,
    "documents": [
        {
            "agencies": [
                {
                    "id": 32000001,
                    "jurisdiction": "LUX",
                    "jurisdiction_id": 3200,
                    "name": "Commission de Surveillance du Secteur Financier",
                    "short_name": "LUX-CSSF"
                }
            ],
            "agency_ids": [32000001],
            "alt_summaries": [],
            "bookmarked": False,
            "cai_category_id": 2083,
            "category": "Warning Notice",
            "cfr_parts": [],
            "children": [],
            "cited_associations": {
                "act_ids": [],
                "bank_ids": [],
                "citation_ids": [],
                "concept_ids": [],
                "named_regulation_ids": []
            },
            "clean_citations": [],
            "complianceai_id": "CAI-LUX-CSSF-12907150",
            "concept_tags": [],
            "created_at": "2023-06-21T09:41:34.547089",
            "deprecated": False,
            "docket_ids": [],
            "dockets": [],
            "document_version_latest": True,
            "flagged": None,
            "full_text": "",
            "full_text_hash": "467cc17f2c",
            "full_xml_hash": None,
            "has_sentences": False,
            "has_unofficial_publication_date": False,
            "hidden": False,
            "id": 12907150,
            "important_dates": {},
            "incoming_citation_ids": [],
            "jurisdiction": "LUX",
            "language": "German",
            "languages": [{"high_confidence": True, "id": 33, "name": "German"}],
            "languages_of_language_related_docs": [
                {"high_confidence": True, "id": 48, "name": "French"},
                {"high_confidence": True, "id": 38, "name": "English"}
            ],
            "meta_table": "agency_updates",
            "official_id": "e6557f95c23be67036167cfdf15db7db70a703f5",
            "parent": None,
            "pdf_hash": "809352de5e7c",
            "pdf_url": None,
            "pipeline_status": "processing_indexing",
            "provenance": "legal_api_docs",
            "publication_date": "2023-06-21T12:00:00",
            "related_documents": [
                {
                    "documents_group_by": "languages",
                    "related_doc_ids": [12907149, 12907148],
                    "related_docs": [
                        {
                            "doc_id": 12907149,
                            "language": "French",
                            "languages": [{"high_confidence": True, "id": 48, "name": "French"}],
                            "title": "Avertissement concernant les activités frauduleuses exercées par la société Paper Bids (site Internet: www.paperbids.com)"
                        },
                        {
                            "doc_id": 12907148,
                            "language": "English",
                            "languages": [{"high_confidence": True, "id": 38, "name": "English"}],
                            "title": "Warning concerning the fraudulent activities carried out by the entity Paper Bids (website: www.paperbids.com)"
                        }
                    ],
                    "relation_type": "Language"
                },
                {
                    "related_docs": [],
                    "relation_type": "organization",
                    "total_count": 0
                }
            ],
            "restriction_type": None,
            "spider_name": "unified-lux-cssf-publication-data",
            "summaries": [],
            "summary_text": "Warnung Warnung vor den Tätigkeiten der Gesellschaft namens Paper Bids (Internetseite: www.paperbids.com) Warnung: Illegale Aktivitäten Gesellschaftsname: Paper Bids Angeblicher Gesellschaftssitz: 80, Av. De la liberté, Luxembourg Genehmigungen in Luxemburg: Keine Internetseite: www.paperbids.com E-Mail Adresse: / Telefonnummer: / Anmerkung: Die Gesellschaft ist nicht von der CSSF registriert und wird auch nicht von ihr überwacht.",
            "times_cited": 0,
            "title": "Warnung vor den Tätigkeiten der Gesellschaft namens Paper Bids (Internetseite: www.paperbids.com)",
            "topics": [],
            "translated": False,
            "updated_at": "2023-06-21T09:46:01.178583",
            "user_has_access": True,
            "web_url": "https://www.cssf.lu/de/2023/06/warnung-vor-den-taetigkeiten-der-gesellschaft-namens-paper-bids-internetseite-www-paperbids-com/",
            "DateProcessed": "2023-06-21 16:01:52.048027",
            "alert_name": "alert",
            "alert_creator_user_name": "user",
            "sentence_main": ""
}

GET Agencies

This method returns the most up-to-date list of agencies.

Parameter Description Type
accept-encoding This allows the response to be in JSON so it can be rendered in this Interactive API. Please keep 'identity' as this parameter's value.
id Represents a valid Compliance.ai agency id. An invalid agency id input will return an error, and acceptable input data currently ranges from 1-9 digits. Example Agency ID: 573 - 'CFPB'. Complete list can be found here integer
sort Sort agencies by 'id'. Any other input value will not affect the search results. string
order Sort in Descending 'desc' or Ascending 'asc' order. Any other input value will return an error. string

Sample Request URI

https://api.compliance.ai/v1/agencies?id=800000002&sort=id&order=desc&api_key=YOURKEY

Sample Response 

{
    "agencies": [{
        "active": true,
        "blacklisted": false,
        "cai_categories": [{
            "active_id": null,
            "description": "Document with a means of issuing federal directives in the United States, used by the president of the United States, that manages operations of the federal government.",
            "doc_meta_category_id": 9,
            "from_id": null,
            "id": 3230,
            "is_archived": false,
            "is_synced": null,
            "name": "Executive Order",
            "surface_in_filter": true,
            "to_id": null,
            "updated_at": "2022-10-01T01:23:47.269907"
        }],
        "description": "",
        "id": 800000002,
        "jurisdiction": "DNK",
        "jurisdiction_id": 8000,
        "logo_url": null,
        "name": "Denmark Ministry of Business",
        "parent_id": null,
        "popular": false,
        "short_name": "DNK-MOB",
        "slug": "dnk-business-ministry",
        "times_cited": null,
        "type": "federal",
        "url": "https://em.dk/",
        "words": {
            "agency_id": 800000002,
            "departments": [],
            "subdepartments": [],
            "synonyms": []
        }
    }]
}

GET Jurisdictions 

 This method returns the most up-to-date list of jurisdictions.

Parameter Description Type
accept-encoding This allows the response to be in JSON so it can be rendered in this Interactive API. Please keep 'identity' as this parameter's value.
active If set to true, results will only return jurisdictions that are active in Compliance.ai. bool
id Represents a valid Compliance.ai jurisdiction id. An invalid jurisdiction id input will return an error, and acceptable input data currently ranges from 1-4 digits. Example Jurisdiction ID: 6 - 'US-CA, California' . Complete list can be found here integer
sort Sort jurisdictions by 'id'. Any other input value will not affect the search results. string
order Sort in Descending 'desc' or Ascending 'asc' order. Any other input value will return an error. string

Sample Request URI

https://api.compliance.ai/v1/jurisdictions?active=true&id=9000&sort=id&order=desc&api_key=YOUKEY

Sample Response

{
    "all_jurisdictions": [{
        "active": true,
        "category": "international",
        "country": "AUT",
        "country_display_name": "AUT",
        "id": 9000,
        "name": "Austria",
        "parent_id": null,
        "short_name": "AUT",
        "times_cited": null
    }]
}

GET Topics

This method returns the most up-to-date list of topics.

Parameter Description Type
accept-encoding This allows the response to be in JSON so it can be rendered in this Interactive API. Please keep 'identity' as this parameter's value.
active_streaming If set to true, results will only return jurisdictions that are active in Compliance.ai. bool
id Represents a valid Compliance.ai topic id. An invalid topic id input will return an error, and acceptable input data currently ranges from 1-2 digits. Example Topic ID: 11 - 'Securities'. Complete list can be found here integer
sort Sort topics by 'id'. Any other input value will return an error. string
order Sort in Descending 'desc' or Ascending 'asc' order. Any other input value will return an error. string

Sample Request URI

https://api.compliance.ai/v1/topics?active_streaming=true&id=19&sort=id&order=desc&api_key=YOURKEY
{
    "topics": [{
        "active_streaming": true,
        "description": "Small-dollar, short-term loans, generally for $500 or less.",
        "id": 19,
        "name": "Payday Lending",
        "prediction_surfacing_threshold": 0.99
    }]
}

GET Document Types

 This method returns the most up-to-date list of document types.

Parameter Description Type
accept-encoding This allows the response to be in JSON so it can be rendered in this Interactive API. Please keep 'identity' as this parameter's value.
query Allows a random bag of words search with boolean search terms and does a relevancy search against Category and Metacategory name and description string
cai_category_id Represents a valid Compliance.ai document category. An invalid document category input will return an error. Complete list can be found here integer
cai_metacategory_id Represents a valid Compliance.ai document metacategory. An invalid document metacategory input will return an error. intege

Sample Request

https://api.compliance.ai/v1/document_type?cai_category_id=1001&api_key=YOURKEY
{
    "cai_categories": {
        "1001": {
            "all_active_ids": [
            1001],
            "cai_metacategory_id": 4,
            "description": null,
            "id": 1001,
            "is_active": true,
            "name": "Handbook Navigation",
            "surface_in_filter": false,
            "updated_at": "2022-10-01T01:23:47.269907"
        }
    },
    "cai_metacategories": {}
}

GET Regulations

 This method returns the most up-to-date list of regulations.

Parameter Description Type
accept-encoding This allows the response to be in JSON so it can be rendered in this Interactive API. Please keep 'identity' as this parameter's value.
id Represents a valid Compliance.ai regulation id. An invalid regulation id input will return an error. Acceptable input data currently has 1-3 digits. Example Regulation ID: 120 - 'Basel III'. Complete list can be found here integer
sort Sort jurisdictions by 'id'. Any other input value will return an error. string
order Sort in Descending 'desc' or Ascending 'asc' order. Any other input value will return an error. string

Sample Request URI

https://api.compliance.ai/v1/regulations?id=120&sort=id&order=desc&api_key=YOURKEY
{
    "regulations": [{
        "act_ids": [],
        "agency_ids": [
        80,
        188],
        "doc_ids": [
        2158182,
        2491457,
        1657455,
        2491480,
        3009674,
        2160433,
        2159714,
        2159697,
        1657511],
        "id": 120,
        "jurisdiction": "US",
        "jurisdiction_id": 0,
        "main_doc_id": null,
        "name": "Basel III",
        "nicknames": ["Regulation Y", "Reg Y", "Regulation H", "Reg H", "Regulation Q", "Reg Q"],
        "short_name": "Basel III",
        "times_cited": 9566
    }]
}

GET Acts

 This method returns the most up-to-date list of acts.

Parameter Description Type
accept-encoding This allows the response to be in JSON so it can be rendered in this Interactive API. Please keep 'identity' as this parameter's value.
id Represents a valid Compliance.ai act id. An invalid act id input will return an error. Acceptable input data currently ranges from 1-5 digits. Example Act ID: 769 - 'Bank Secrecy Act'. Complete list can be found here integer
date Returns acts based on date. Format the input value as 'YYYY-MM-DDT00:00:00'. Example input: '1970-10-26T00:00:00' string
sort Sort acts by 'id'. Any other input value will return an error. string
order Sort in Descending 'desc' or Ascending 'asc' order. Any other input value will return an error. string
limit Limit the number of documents returned. Default = 1000. Max value = 1000. integer
offset If your search finds 'count'=100 documents, offset=20 will return 80 documents and remove the first 20. Search results will still show the document 'count' without the offset. If the offset input value is greater than the document 'count', the search result will return 0 documents. integer

Sample Request URI

https://api.compliance.ai/v1/acts?id=11150&sort=id&order=desc&api_key=YOURKEY

Sample Response

{
    "acts": [{
        "citations": ["Public Law 110-53", "121 Stat. 543", "47 U.S.C. 901"],
        "date": "2007-08-03T00:00:00",
        "doc_ids": [
        2091991],
        "id": 11150,
        "name": "911 Modernization Act",
        "nicknames": [],
        "times_cited": 1
    }],
    "limit": 1000,
    "offset": 0,
    "size": 1
}

POST Diffing

Compare two documents by inputting two document IDs. 

Sample Request 

{
    "doc_id_v1": "5660867",
    "doc_id_v2":  "5660866" 
}

Sample Response

"<h3><div id=\"81418244\">The Commonwealth of Massachusetts</div></h3> <p></p><div id=\"81418245\">PRESENTED BY:</div> <p><ins></ins></p><div id=\"81418246\"><ins>Dylan A. Fernandes and Julian Cyr</ins></div> <p><del></del></p><div id=\"81418217\"><del>Paul W. Mark</del></div> <p></p><div id=\"81418247\">To the Honorable Senate and House of Representatives of the Commonwealth of Massachusetts in General</div> <p></p><div id=\"81418248\">Court assembled:</div> <p></p><div id=\"81418249\">The undersigned legislators and/or citizens respectfully petition for the adoption of the accompanying bill:</div> <p></p><div id=\"81418250\">An Act <ins>authorizing the University of Massachusetts to convey a certain parcel of land with buildings thereon in the town of Nantucket to the town of Nantucket Affordable
Housing Trust</ins><p><ins></ins></p><div id=\"81418251\"><ins>Fund.</ins></div> <del>establishing the Franklin County Sheriff's opioid use disorder education, treatment and recovery fund.</del></div>"

To see this diffing in HTML format, copy this sample response into a text editor and save it as html file format. Open the file in your browser, and you should see the diffing like below:

The Commonwealth of Massachusetts

PRESENTED BY:

Dylan A. Fernandes and Julian Cyr

Paul W. Mark
To the Honorable Senate and House of Representatives of the Commonwealth of Massachusetts in General
Court assembled:
The undersigned legislators and/or citizens respectfully petition for the adoption of the accompanying bill:
An Act authorizing the University of Massachusetts to convey a certain parcel of land with buildings thereon in the town of Nantucket to the town of Nantucket Affordable Housing Trust

Fund.
establishing the Franklin County Sheriff's opioid use disorder education, treatment and recovery fund.

GET Suggestion 

This returns auto-suggest results based on text input.

Sample Request

https://api.compliance.ai/v1/acts?id=11150&sort=id&order=desc&api_key=YOURKEY
{
    "results": [{
        "_matched_queries": ["name"],
        "_score": 13.270155,
        "_type": "acts",
        "citations": ["Public Law 99-579", "100 Stat. 3309"],
        "date": "1986-10-28T00:00:00",
        "doc_ids": [],
        "id": 10337,
        "name": "Truth in Mileage Act of 1986",
        "nicknames": [],
        "times_cited": 3
    }]
}

GET PDF

This method returns a PDF file for the document requested. Please note that PDF files are not available for 'Mainstream News' document categories and also not for documents that are protected by copyright by the publishing source.

Sample Request

https://api.compliance.ai/v1/pdf?doc_id=2156642&api_key=YOURKEY