Skip to content

Datasets

A dataset is a versioned data file with a title, description, tags, license and citation. You can keep training data or measured results beside the circuits that use them. Every upload becomes a new version, identified by the SHA-256 hash of its content.


A dataset has one declared format: CSV, NPY, HDF5, JSON or Parquet. QubitHub stores each upload as data.<format>, and does not check that the file’s content matches the format you declared, so upload the right kind of file.


The dataset API takes a Bearer token. API keys are not accepted on these routes. Log in to get one; it is valid for 15 minutes. When calls return 401, run the login step again:

Terminal window
read -rsp "Password: " QH_PASSWORD; echo
TOKEN=$(jq -n --arg e "[email protected]" --arg p "$QH_PASSWORD" '{email: $e, password: $p}' \
| curl -s -X POST https://qubithub.co/api/auth/login -H "Content-Type: application/json" -d @- \
| jq -r .access_token)

See Authentication for refresh tokens and the other options.


Terminal window
DATASET_ID=$(curl -s -X POST https://qubithub.co/api/datasets \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"name": "bell-counts", "title": "Bell state counts", "format": "csv", "is_public": false}' \
| jq -r .id)

Datasets are public by default ("is_public": true). Optional fields are description (Markdown), tags, license (e.g. MIT) and citation (BibTeX or APA).

On the Free tier during beta you can own up to 5 datasets; creating a sixth returns 403.

Keep the dataset’s id. There is no list of your own datasets yet, and the public list (GET /api/datasets) shows public datasets only.

Terminal window
curl -s -X POST "https://qubithub.co/api/datasets/$DATASET_ID/versions?commit_message=First%20run" \
-H "Authorization: Bearer $TOKEN" -F "[email protected]" \
| jq '{version_number, commit_hash, size_bytes}'

Only the owner can upload. Each new file becomes the next version (1, 2, …). If you upload exactly the same bytes as an existing version, you get that version back, and no new one is created.

Terminal window
curl -s -f -o bell-counts.csv "https://qubithub.co/api/datasets/$DATASET_ID/download" \
-H "Authorization: Bearer $TOKEN"

Download always returns the latest version. There’s no way yet to download an earlier one. A public dataset downloads without a token.

Terminal window
curl -s "https://qubithub.co/api/datasets/$DATASET_ID/stats" -H "Authorization: Bearer $TOKEN"

Returns downloads_count, stars_count, forks_count and size_bytes.

POST /api/datasets/{id}/fork copies a dataset you can open into your account, optionally with {"name": "my-copy"}. Forks are limited to 5 per minute.

Terminal window
curl -s -X POST https://qubithub.co/api/datasets/$DATASET_ID/fork \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"name": "my-copy"}' | jq '{id, name, forked_from}'

  • Public: anyone, including signed-out visitors.
  • Private, owned by a person: the owner only.
  • Private, owned by an organization: it is not consistent yet. Active members of the organization can preview, read the statistics of, and fork the dataset, but opening its details and downloading it are limited to the owner. Treat a private organization dataset as owner-only until this is fixed.

  • Preview. GET /api/datasets/{id}/preview currently fails with a server error for any dataset that has rows. Download the file instead.
  • CLI commands for datasets.
  • Downloading an earlier version.
  • Checking an upload against the declared format.
  • A list of your own datasets, including the private ones.
  • A public gallery.

Need help? See Troubleshooting or email [email protected].