Back to Home

SDKs & Libraries

Official client libraries for TypeScript/Node.js and Python. Fully typed, zero dependencies, and maintained by the ComplianceGrid team. Or use plain cURL / HTTP from any language.

Node.js / TypeScript

@compliancegrid/sdkv1.0.0
Install:npm install @compliancegrid/sdk
example.ts
import ComplianceGrid from "@compliancegrid/sdk";

const cg = new ComplianceGrid({
  apiKey: process.env.COMPLIANCEGRID_API_KEY,
});

// Screen parties against OFAC, BIS & 12 federal watchlists
const result = await cg.compliance.screenParties([
  { name: "Huawei Technologies", country: "CN", type: "CONSIGNEE" },
]);
console.log(result.data.summary);

// Classify an HS code with AI
const hs = await cg.hs.classify({ description: "stainless steel kitchen knives" });
console.log(hs.data.classifications);

// Search FFL holders in Texas
const ffls = await cg.firearms.searchFFL({ state: "TX", limit: 10 });
console.log(ffls.data.results);

Python

compliancegridv1.0.0
Install:pip install compliancegrid
example.python
from compliancegrid import ComplianceGrid
import os

cg = ComplianceGrid(api_key=os.environ["COMPLIANCEGRID_API_KEY"])

# Screen parties against OFAC, BIS & 12 federal watchlists
result = cg.compliance.screen_parties([
    {"name": "Huawei Technologies", "country": "CN", "type": "CONSIGNEE"}
])
print(result["data"]["summary"])

# Classify an HS code with AI
hs = cg.hs.classify(description="stainless steel kitchen knives")
print(hs["data"]["classifications"])

# Search FFL holders in Texas
ffls = cg.firearms.search_ffl(state="TX", limit=10)
print(ffls["data"]["results"])

cURL

Any language via REST
Install:No installation needed
example.curl
# Screen a party against federal watchlists
curl -X POST https://sandbox.api.compliancegrid.ai/v1/compliance/restricted-party-screening \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $CG_TOKEN" \
  -d '{"parties": [{"name": "Huawei Technologies", "country": "CN"}]}'

# Classify an HS code
curl -X POST https://sandbox.api.compliancegrid.ai/v1/hs/classify \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $CG_TOKEN" \
  -d '{"description": "stainless steel kitchen knives"}'

# Search FFL holders
curl "https://sandbox.api.compliancegrid.ai/v1/firearms/ffl/search?state=TX&limit=5" \
  -H "Authorization: Bearer $CG_TOKEN"