# Data

> What the Spare Cores Navigator data covers, its datasets and their licenses, the ways to access it, how fresh it is, and what to know when using it.

The Spare Cores Navigator data covers the cloud servers, managed databases,
storage and other resources of the vendors listed under
[What's covered](https://docs.sparecores.com/overview.md#whats-covered): their specs, prices and benchmark
scores.
This page describes what the data holds, where to get it and under which
license, and what to know when using it. For the current numbers of server
types, zones, benchmark scores and prices, see the
[Navigator page on sparecores.com](https://sparecores.com/about/navigator).

## What's in the data

| Resource | Specs | Prices | Benchmark scores | Tables |
| -------- | ----- | ------ | ---------------- | ------ |
| Servers | CPU, memory, GPUs, storage, network | per region and zone, on-demand and spot | yes | `server`, `server_price` |
| Managed databases (PostgreSQL) | engine versions, high availability, backups | per region | yes | `database`, `database_price` |
| Storage | type, size, IOPS and throughput limits | per region | – | `storage`, `storage_price` |
| Storage of managed databases | size, IOPS and throughput limits, redundancy | per region | – | `database_storage`, `database_storage_price` |
| Traffic | – | inbound and outbound, per region | – | `traffic_price` |
| IPv4 addresses | – | per region | – | `ipv4_price` |

Also in the data:

- **Where:** the vendors, their regions and availability zones, and the
  countries of the regions (`vendor`, `region`, `zone`, `country`), and the
  compliance frameworks, such as SOC 2, of each vendor (`compliance_framework`,
  `vendor_compliance_link`).
- **Benchmarks:** the definition of each [benchmark](https://docs.sparecores.com/benchmarks.md)
  (`benchmark`), and the scores of the servers and managed databases
  (`benchmark_score`).
- **Descriptions:** plain English descriptions of the servers' hardware,
  performance, cost-efficiency and workload fit (`server_description`).

Managed databases are covered at all vendors but Hetzner Cloud, which doesn't
offer them. The [Schemas](https://docs.sparecores.com/schemas.md) describe every
table and column.

## Datasets and licenses

| Dataset | What | Where | License |
| ------- | ---- | ----- | ------- |
| Crawler Data | JSON dumps of the tables, one file per record, with the history of the specs in git; not the prices and benchmark scores | [`sc-data-dumps`](https://github.com/SpareCores/sc-data-dumps) | CC BY-SA 4.0 |
| Inspector Data | the raw hardware inspection outputs and benchmark results of each server | [`sc-inspector-data`](https://github.com/SpareCores/sc-inspector-data) | CC BY-SA 4.0 |
| Database | the Crawler and Inspector Data compiled into one SQLite file, with the prices and benchmark scores | [SQLite](https://docs.sparecores.com/sqlite.md), the Data Wrapper (`sparecores-data`) | BSL 1.1, converting to CC BY-SA 4.0 three years after each release |
| API | the database, queried over HTTP | [API](https://docs.sparecores.com/api.md) | free under a fair use policy |

The Inspector Data comes from the [container images](https://docs.sparecores.com/images.md) that the
Inspector runs on the servers (see [Under the hood](https://docs.sparecores.com/under-the-hood.md)), and the
database's `_metadata` table records the details of its license. See
[Licensing](https://docs.sparecores.com/overview.md#licensing) for the licenses of the code, and for
commercial use.

## Which way to use

| Way | Best for |
| --- | -------- |
| [Web UI](https://docs.sparecores.com/web-ui.md) | finding and comparing servers without writing code |
| [API](https://docs.sparecores.com/api.md) | applications and scripts: filters, sorting, and prices converted to one currency, so that all vendors compare |
| [SQLite](https://docs.sparecores.com/sqlite.md) | analysis with SQL or Python over the whole dataset, offline |
| Crawler Data | how the specs changed over time, in the git history of the dumps (the history of prices and benchmark scores is not published) |
| Inspector Data | the raw outputs behind the hardware details and benchmark scores |

To get started with each, see [Getting started](https://docs.sparecores.com/getting-started.md), the
[API examples](https://docs.sparecores.com/api/examples.md), and the example queries of the
[SQLite](https://docs.sparecores.com/sqlite.md#get-to-know-the-data) page.

## Freshness and versions

- The data, including the prices, is updated about once or twice an hour.
  The [status page](https://status.sparecores.com) shows whether the
  scheduled updates of the database ran on time, with their history, and
  the uptime of the API and the website.
- Every API response says which version of the database it was built from
  (the `SC-Data-Hash` and `SC-Data-Published-At` headers, also in
  `GET /healthcheck`). To read several tables of the same version, use the
  API's [snapshots](https://docs.sparecores.com/api.md#data-versions-and-snapshots).
- The Data Wrapper checks for a newer database every 10 minutes in Python,
  and each database records when it was published in its `_metadata` table.
- Server types, prices and scores that are no longer available stay in the
  database, with their `status` telling it.

## Things to know

- **Currencies:** prices are in the vendor's currency in the database, e.g.
  EUR for Hetzner Cloud, OVHcloud and UpCloud. The database has no exchange
  rates, so compare prices in one currency, or use the API, which converts
  them (`currency`, USD by default).
- **Units:** prices are per their `unit`, e.g. per hour for servers. Memory
  is in MiB in the database (`memory_amount`), but the API's filters take GB.
- **Status:** filter on `status = 'ACTIVE'` for the current offerings.
- **IDs:** a region, zone or server ID is unique only within its vendor, so
  every table refers to these by the vendor ID and the record's ID together,
  e.g. a server price to its server, region and zone. Join on both.
- **Empty specs:** specs that the vendor doesn't publish and the inspection
  couldn't measure are empty (`NULL`), e.g. the CPU model, cores, clock speed
  or caches of some server types, or the memory speed of most of them. Leave
  them out explicitly when filtering or sorting by them.
- **Benchmark scores:** a score belongs to a server or a managed database
  (`resource_type`, and `resource_id` its ID). A benchmark's configuration,
  e.g. the model of an LLM benchmark, is JSON (`config`): match its fields,
  e.g. with `json_extract` in SQLite, as it can have other fields too. The
  API's `benchmark_config` instead matches the text exactly, so copy it from
  [`/benchmark_configs`](https://docs.sparecores.com/api/reference/search-benchmark-configs-benchmark-configs-get.md).
- **Missing scores:** a server type can lack some or all benchmark scores,
  e.g. when a benchmark failed on it, or when we couldn't start it (no budget
  or quota, or the vendor had no capacity). The
  [benchmark coverage](https://sparecores.com/navigator/benchmark-coverage)
  page of sparecores.com shows which scores are measured.
- **Scores:** the [SCore](https://docs.sparecores.com/glossary.md#score) is the multi-core CPU speed of a
  server, and the API's `score_per_price` divides it by the hourly price.
  Other benchmarks measure other workloads, in their own units, see
  [Benchmarks](https://docs.sparecores.com/benchmarks.md).

## References

- [Schemas](https://docs.sparecores.com/schemas.md): the tables and columns of the database, which the API
  responses follow too.
- [Benchmarks](https://docs.sparecores.com/benchmarks.md): the benchmark workloads behind the scores, with
  their units and the distribution of their results.
- [Glossary](https://docs.sparecores.com/glossary.md): the terms used in the data and these docs.

## Report a data issue

A missing server, a wrong price or spec: open an issue in
[`sc-crawler`](https://github.com/SpareCores/sc-crawler/issues), which
collects the data, or in
[`sc-images`](https://github.com/SpareCores/sc-images/issues) for a benchmark
result. See [Getting help](https://docs.sparecores.com/getting-started.md#getting-help) for the other
places.
