The Stacks Project

Overview of the API

It is possible to query the Stacks project yourself through an API. This way you don't have to scrape the information from the HTML pages and it is consistent with our goal that the content of the Stacks project be as open as possible.

We can think of several applications:

If you intend to use this API, please contact us at This interface is not stable yet, please get in touch to discuss this with us.

At the moment there are two types of information accessible through the interface:

  1. statements of the tags (in various flavours);
  2. the data for graphs.

We are open to suggestions, please get in touch if you want to use this interface and if you have comments.


There are four different possibilities to get the statement of a tag:

  1. HTML, without proof:‹tag›/content/statement

    example: HTML statement for tag 015I

  2. HTML, with proof:‹tag›/content/full

    example: HTML statement (with proof) for tag 015I

  3. LaTeX, without proof:‹tag›/content/statement/raw

    example: LaTeX statement for tag 015I

  4. LaTeX, with proof:‹tag›/content/full/raw

    example: LaTeX statement (with proof) for tag 015I

Due to the way the content is parsed and inserted in the database, the LaTeX output contains HTML links for references. If you wish to use this type of output without this small nuisance, please contact us.

Because the mathematics is parsed by MathJax, the HTML output contains raw LaTeX math. It is up to the user to handle this (e.g. either use MathJax, or some image generation tool).


The dependency graphs for every tag are generated using D3.js. This JavaScript library uses JSON files to render the graphs. But if you want to create your own visualisations (or extract statistical information!) you can use these files too, they're there anyway.

There are three types of graphs, each with their own data structure:

  1. force-directed:‹tag›/graph/force

    This graph contains all nodes of the dependency graph of a result. It consists of a list of nodes corresponding to tags (together with some meta-information) and a list of edges. These graphs are directed acyclic graphs, no multiple nodes.

    example: data for the force-directed graph of tag 015I

  2. cluster‹tag›/graph/cluster

    This graph contains a subset of the nodes (at most either 6 levels deep, or 150 nodes) and is a tree. It contains the dependencies as a nested structure. There are repeated nodes (if a result is used in two different tags it is repeated because it is a tree). Again, there is meta-information contained in the JSON file.

    example: data for the clustered graph of tag 015I

  3. collapsible (or: per chapter)‹tag›/graph/collapsible

    This graph groups results first by chapter, then by section. Hence it is a tree of 4 levels deep. It contains all tags of the dependency graphs, but of course the logical dependencies are not visible. Whenever a tag is a section, it is contained in the graph both on the lowest level (as a tag) and on the second-to-lowest level (as a section). Again, there is meta-information contained in the JSON file.

    example: data for the collapsible graph of tag 015I


This is just a preliminary version. It was created because we needed it ourselves (for the graphs and the previews of the tags in the graphs). Hence, if you have a feature request, send an email to and we'll see what we can do.