SDKs

SDKs overview

LegalCloud provides client libraries for the three most common server-side languages. They read your LegalCloud data (documents and their versions, sites, resources, statistics, tokens and API usage), show a document in your application (as HTML or as an iframe) and send the headers that feed your source analytics. Creating, editing and deleting content is done in the dashboard.

Available SDKs

SDKVersionRequirementsGuide
JavaScript / TypeScript1.1.0Node 18+ (global fetch) or a modern browser; ES module + CommonJS, TypeScript typesJavaScript SDK quickstart
Python1.1.0Python 3.8+, requests 2.28+Python SDK quickstart
PHP1.1.0PHP 7.4+, ext-curl, ext-json (no WordPress needed)PHP SDK quickstart

All three expose the same features:

FeatureWhat it does
DocumentsgetDocument (rendered HTML), list (with a paginated iterator), detail, languages, limits, versions and version diff
EmbedspublicUrl and iframeHtml build the public address and the <iframe> tag
Sites, resourcesList and detail of sites, resource listing, usage and statistics
StatisticsTotals, KPIs, views, per-document stats, visits, source breakdown and top sites
AccountToken list, API usage and the log of recent API calls
ReliabilityTimeout, automatic retries with exponential backoff for 429, 5xx and network errors (a Retry-After header wins), quota and rate-limit headers in lastQuota / lastRateLimit
ErrorsValidationError, AuthenticationError, PermissionDeniedError, NotFoundError, RateLimitError, ServerError, NetworkError (names adapt to each language)

The methods map one to one to the read endpoints of the REST API; each one needs the scope that the API reference lists (documents:read, sites:read, resources:read, organization:read).

Getting the SDK

The SDKs are distributed as ZIP files from your dashboard:

  1. Sign in at https://dash.legalcloud.info/auth/login.
  2. Open Downloads.
  3. Download the SDK you need (for example legalcloud_sdk-js-1.1.0.zip). The page shows the SHA-256 fingerprint of each file so you can verify it.
  4. Unzip it: you get a legalcloud folder with the README, the changelog and the license.
  5. Follow the quickstart of your language.

There are no packages published on npm, PyPI or Packagist: install them from the downloaded folder as explained in each guide.

Addresses

The SDKs call the API at https://api.legalcloud.info and build public pages on https://dash.legalcloud.info by default; you can override both (baseUrl, embedBaseUrl).

Authentication

The SDKs send your API token as a bearer credential. See Authentication with bearer tokens.

Tracking

Each request carries X-LegalCloud-Source, X-LegalCloud-Site, X-LegalCloud-Plugin-Id and X-LegalCloud-Version so that your dashboard can show which integration and which website are reading each document. See Viewing analytics.

Next steps

Last updated: 2026-10-27

Sign up FREE for life, no credit card required

Create free account