SDKs & install snippets

Official clients for JavaScript/TypeScript, Python, and cURL. Pick your stack, drop in a key, ship.

JavaScript / TypeScript AVAILABLE

npm install @hempdata/sdk

Not yet on npm — install directly from GitHub in the meantime:

npm install stevesgoods/hempdata-js
import { HempData } from '@hempdata/sdk'

const hd = new HempData({ apiKey: process.env.HEMPDATA_KEY })

const r = await hd.compliance.check({
  state: 'KY', substance: 'cbd', productType: 'edibles'
})
console.log(r.legalStatus)   // 'legal_with_restrictions' | ...
console.log(r.sources)       // citation chain
console.log(r.disclaimer)    // display alongside the result
GitHub → README → Changelog →

Python AVAILABLE

pip install hempdata

Not yet on PyPI — install directly from GitHub in the meantime:

pip install git+https://github.com/stevesgoods/hempdata-python.git
import os
from hempdata import HempData

hd = HempData(api_key=os.environ["HEMPDATA_KEY"])
r = hd.compliance.check(
    state="KY", substance="cbd", product_type="edibles"
)
print(r.legal_status)   # "legal_with_restrictions" | ...
print(r.sources)        # citation chain
print(r.disclaimer)     # display alongside the result
GitHub → README → Changelog →

cURL AVAILABLE

export HEMPDATA_KEY=hd_live_...
curl "https://api.hempdata.io/v1/compliance/check\
?state=KY&substance=cbd&product_type=edibles" \
  -H "Authorization: Bearer $HEMPDATA_KEY"
Full reference →

OpenAPI 3.1 AVAILABLE

Generate a client in any language with the OpenAPI spec.

npx @openapitools/openapi-generator-cli \
  generate -i https://api.hempdata.io/openapi.json \
  -g go -o ./hempdata-go
Download spec →