logo Netzschleuder network catalog, repository, and centrifuge

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.

ParameterValueDescriptionExample
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.

FieldDescription
titleHuman-readable title.
descriptionDescription, in Markdown.
tagsList of tags.
date_addedDate when the entry was added to the repository (YYYY-MM-DD).
netsNames of the networks in the entry. For a single network, this is the entry name itself.
analysesSummary statistics (num_vertices, num_edges, average_degree, …). For entries with several networks, a dictionary keyed by network name.
citationList of [text, url] pairs for the upstream sources.
bibtexBibTeX records for the citations.
urlUpstream URL.
restrictedWhether 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).

FormatDescription
gt.zstgraph-tool binary format, zstd-compressed
xml.zstGraphML, zstd-compressed
gml.zstGML, zstd-compressed
csv.zipCSV 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.

ParameterValueDescriptionDefault
thumbbooleanReturn 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")]