# 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:

• developing smartphone apps / mobile versions of the Stacks website;
• extracting meta-information about the Stacks project;

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.

## Statements

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

1. HTML, without proof:
http://stacks.math.columbia.edu/data/tag/‹tag›/content/statement

example: HTML statement for tag 015I

2. HTML, with proof:
http://stacks.math.columbia.edu/data/tag/‹tag›/content/full
3. LaTeX, without proof:
http://stacks.math.columbia.edu/data/tag/‹tag›/content/statement/raw

example: LaTeX statement for tag 015I

4. LaTeX, with proof:
http://stacks.math.columbia.edu/data/tag/‹tag›/content/full/raw

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

## Graphs

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:
http://stacks.math.columbia.edu/data/tag/‹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.

2. cluster
http://stacks.math.columbia.edu/data/tag/‹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.

3. collapsible (or: per chapter)
http://stacks.math.columbia.edu/data/tag/‹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.

## Suggestions?

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 stacks.project@gmail.com and we'll see what we can do.