Using Your API Key

Your API key lets you download certain datasets programmatically or after you’ve registered. Keep it secret.

Why we require an API key

We only collect minimal details (name, email). Use the key via a browser cookie or send it in scripts (see below).

If you have any questions, give SAMS IT a shout!

Where the key lives

We suggest you keep a note of it in a safe place.

Tip: If you’ve registered in your browser already, you can use the cookie value from DevTools → Application → Cookies.

Browser (no code)

Just click a file link. If prompted, complete the registration form once. The site sets the cookie and your download proceeds.

curl

curl -L \
  "https://thredds.sams.ac.uk/thredds/fileServer/path/to/file.nc?api_key=YOUR_API_KEY" -o file.nc

Python (requests)

import requests
url = "https://thredds.sams.ac.uk/thredds/fileServer/path/to/file.nc?api_key=YOUR_API_KEY"
r = requests.get(url, allow_redirects=True, timeout=60)
open("file.nc", "wb").write(r.content)

Common issues

If you need a new key or access, contact the SAMS IT team.