JSON API
Read-only access to the catalog for programs. All endpoints
use GET, return JSON
(except file downloads and drawings), and are relative
to https://networks.skewed.de.
Parameters are given in the query string (e.g. ?tags=Social&full=true).
Boolean parameters are false if they are left out, or given as
0, false, no or off (in any case),
and true otherwise, also without a value (e.g. ?full).
List entries
GET /api/nets
Returns the names of all entries in the catalog, or their
full records if full is given.
| Parameter | Value | Description | Example |
|---|---|---|---|
full |
boolean | Return a dictionary mapping each name to its record (as in entry details) instead of a list of names. | full=true |
fields |
field names, separated by commas | With full, only these fields of the records
(see entry details), which makes the
response smaller and faster. Unknown fields respond
with 400. |
fields=nets,analyses |
tags |
tag names, separated by commas | Only entries with at least one of the tags are returned. Tags are matched exactly (including their case); see the statistics for the tags in use. | tags=Social,Offline |
exclude |
entry names, separated by commas | Entries to leave out. | exclude=advogato,chess |
Example: /api/nets?tags=Social,Offline
["7th_graders", "add_health", "ambassador", "baseball", ...]
Entry details
GET /api/net/<name>
Returns the record of a single entry. Responds
with 404 if the entry does not exist.
| Field | Description |
|---|---|
title | Human-readable title. |
description | Description, in Markdown. |
tags | List of tags. |
date_added | Date when the entry was added to the repository (YYYY-MM-DD). |
nets | Names of the networks in the entry. For a single network, this is the entry name itself. |
analyses | Summary statistics (num_vertices, num_edges, average_degree, …). For entries with several networks, a dictionary keyed by network name. |
citation | List of [text, url] pairs for the upstream sources. |
bibtex | BibTeX records for the citations. |
url | Upstream URL. |
restricted | Whether the files require authorization. |
Example: /api/net/7th_graders
{
"title": "Vickers 7th Graders (1981)",
"tags": ["Social", "Offline", "Multilayer", "Unweighted", "Metadata"],
"nets": ["7th_graders"],
"analyses": {"num_vertices": 29, "num_edges": 740, "is_directed": true, ...},
"restricted": false,
...
}
Download files
GET /net/<name>/files/<net>.<format>
Downloads a network file. <net> is one of the
names listed in nets; for an entry with a single
network it equals <name>. Files
of restricted entries respond
with 401 unless an access token, obtained
on request, is given in the
WWW-Authenticate header of the request, as
Bearer <token> (this is what
graph-tool does with the token it is given).
| Format | Description |
|---|---|
gt.zst | graph-tool binary format, zstd-compressed |
xml.zst | GraphML, zstd-compressed |
gml.zst | GML, zstd-compressed |
csv.zip | CSV edge and node lists, zip archive |
The largest networks (billions of edges) are only available in
the gt.zst format; requesting them in the other formats
responds with 404. They are shown with a dash in the download columns
of their entries' pages.
Examples: /net/advogato/files/advogato.gt.zst,
/net/iwdb/files/food_web_thompson_AkatoreA.csv.zip
Drawings
GET /draw/<name>[/<net>]
Returns a drawing of the network as a PNG image, or its
thumbnail. The network name is only needed for entries with several
networks. The drawings are made when the networks are processed; a
request for a drawing that does not exist (yet) responds with
404.
| Parameter | Value | Description | Default |
|---|---|---|---|
thumb | boolean | Return the thumbnail (at most 1000×1000 pixels) instead of the full drawing. | false |
Examples: /draw/iwdb/food_web_thompson_AkatoreA, /draw/iwdb/food_web_thompson_AkatoreA?thumb=True
Access from graph-tool
The graph-tool library wraps this API. Entry records are available as dictionaries:
import graph_tool.all as gt
gt.collection.ns_info["advogato"]
and networks are downloaded on demand. For entries with several networks, use a slash separator or a tuple:
g = gt.collection.ns["advogato"]
g = gt.collection.ns["iwdb/food_web_thompson_AkatoreA"]
g = gt.collection.ns[("iwdb", "food_web_thompson_AkatoreA")]