Starter kit

Your first chart in five minutes

Every dataset on data.gg has an address you can read from anywhere. There is no sign-up and no key, and it is free. Add .csv to the end of any address to get a spreadsheet-friendly file instead of JSON.

The examples below all draw Guernsey's GDP. To use something else, find it in the list of datasets and swap the address.

JavaScript

Save this as a file ending in .html and open it in a browser. It reads the data and draws a line chart with the free Chart.js library.

<!doctype html>
<html>
<body>
  <canvas id="chart"></canvas>

  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  <script>
    fetch('https://data.gg/api/1.0/economy/gdp')
      .then(response => response.json())
      .then(rows => {
        new Chart(document.getElementById('chart'), {
          type: 'line',
          data: {
            labels: rows.map(row => row['Year']),
            datasets: [{
              label: 'Guernsey GDP (£ million)',
              data: rows.map(row => row['Nominal GDP'])
            }]
          }
        });
      });
  </script>
</body>
</html>

The data can be read from a page on any website. Each row is an object whose keys are the column names you see on the dataset's page.

Python

pandas reads the CSV address directly, so it is three lines to a chart. This works the same in a Jupyter notebook.

# pip install pandas matplotlib
import pandas as pd
import matplotlib.pyplot as plt

gdp = pd.read_csv("https://data.gg/api/1.0/economy/gdp.csv")

gdp.plot(x="Year", y="Nominal GDP", title="Guernsey GDP (£ million)")
plt.show()

Spreadsheet

Google Sheets: paste this into cell A1 of an empty sheet. The data fills in below and to the right, and Sheets refreshes it by itself from time to time.

=IMPORTDATA("https://data.gg/api/1.0/economy/gdp.csv")

Then select the columns you want and choose Insert, then Chart.

Excel: on the Data tab choose From Web, paste the CSV address and load it. Refresh All fetches the latest figures.

Make or Zapier

Both tools can fetch an address on a schedule and pass the rows on to something else, such as a sheet, an email or a chat message. The menu names below may differ slightly as the tools change.

Make

  1. Create a scenario and add the HTTP module Make a request.
  2. Set the URL to https://data.gg/api/1.0/economy/gdp, the method to GET, and turn on Parse response.
  3. Add an Iterator on the response data to get one bundle per row, or use the last item for the latest figure.
  4. Send it on: for example Google Sheets, Add a row, or Slack, Create a message.
  5. Set the schedule. Most datasets change monthly, quarterly or yearly, so once a day is plenty.

Zapier

  1. Create a Zap whose trigger is Webhooks by Zapier, Retrieve Poll (a paid Zapier feature).
  2. Set the URL to https://data.gg/api/1.0/economy/gdp and the deduplication key to the column that identifies a row, here Year.
  3. Zapier then runs the Zap whenever a new row appears, so add the action you want: a message, an email or a spreadsheet row.

No code at all

Good to know

  • The data comes from official Guernsey sources. Each dataset's page names its source, its unit and anything you need to read it correctly.
  • Please say where the data came from, and link to data.gg if you can.
  • Addresses that start /api/1.0/ will keep working. From a command line: curl https://data.gg/api/1.0/economy/gdp