API documentation

Load any licensed dataset in three lines of Python.

Quickstart

Install the SDK:

pip install corpora

Then load a dataset you have licensed:

import corpora
corpora.api_key = "sk_live_..."
ds = corpora.load("pit-radio-1998")
print(ds.schema)

Authentication

All requests require an API key passed in the Authorization header. Keys are created in your workspace settings.

curl https://api.corpora.ai/v1/datasets \
  -H "Authorization: Bearer sk_live_..."

Streaming

Large datasets are streamed in batches. Batches are shuffled and de-duplicated, and names are removed where detected.

for batch in ds.stream(size=512, shuffle=True):
    model.train(batch)

Licences

Every response includes a licence object. Check licence.status before training.

StatusMeaning
commercialCleared for training and production.
research_onlyNon-commercial use. Honour system.
pendingSeller is obtaining rights. Usable in the meantime.
unknownStatus unknown to all parties.

Rate limits

Explorer: 60 requests per minute. Team: 6,000. Enterprise: unlimited, subject to available data.

Errors

CodeMeaning
401Invalid API key.
402Licence required for this dataset.
410Dataset withdrawn. A similar one may be relisted shortly.
451Unavailable for legal reasons in your jurisdiction. Try another region.