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;
- creating your own graphs;
- ... (please make suggestions!)
If you intend to use this API, please contact us at firstname.lastname@example.org. 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:
There are four different possibilities to get the statement of a tag:
- HTML, without proof:
example: HTML statement for tag 015I
- HTML, with proof:
- LaTeX, without proof:
example: LaTeX statement for tag 015I
- LaTeX, with proof:
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).
There are three types of graphs, each with their own data structure:
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.
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.
- collapsible (or: per chapter)
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.
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 email@example.com and we'll see what we can do.