API and site for discovering, cataloguing, and keeping track of publicly-available Desmos graphs. Not affiliated with Desmos. This project is currently in a very early stage of development, so expect lots of breaking changes for the time being.
To host desmosearch-api, follow these instructions the first time you intend to run it:
- Install Nodejs and Rust if you have not already.
- Clone this repository.
- Navigate to the root directory of the repository, and run
cargo run --release. This will run the backend (web server). The backend is the server that exposes the API that allows for the querying of Desmos graphs, and also allows users to access the frontend. This may take a while the first time, as it will have to compile the backend from scratch. - Navigate to
frontend/desmosearch-browser, runnpm install, and then runnpm run buildto compile the frontend- in other words, the website that lists the Desmos graphs. - (Optional) Go to the
test_datasetdirectory, runnpm install, and then runnpm start. This will upload about 130000 graphs to the database (which would otherwise be empty). - Navigate to the page
http://localhost:8000/static/index.htmlto view the frontend. If you see a page of Desmos graphs appear, you're good to go!
If you close the server and wish to run it again, all you need to do is navigate to the root directory of the repository, and run cargo run --release, as everything else will have been set up already.
The Desmosearch API has a single endpoint at /graphs. This will- by default- show you a single graph. By appending a querystring to the URL (examples below), you can sort and filter the content to your liking.
- The
limitparameter tells the server how many graphs to return when querying graphs. - The
offsetparameter tells the server how many graphs to skip before sending back graphs. This is useful if you want to navigate through multiple "pages" of content- e.g. offset could be0for the first page, and10for the second page, thus skipping the first 10 graphs.
- The
idquery parameter lets you filter by graph ID (the unique final path segment of a Desmos graph link) - The
parent_idparameter lets you filter by the ID of a previous version of a graph. - The
nameparameter lets you filter by graph name. - The
creatorparameter lets you filter by graph creator. (Note that, in many cases, this is unknown.) There are two wildcards you can use with these parameters:%(must be escaped as%25), which means "0 or more of any character," and_, which means "one of any character".
Example: /graphs?creator=MathEnthusiast314&limit=10&name=%25fractal%25. This query returns exactly ten graphs which have been created by MathEnthusiast314, and contain the string fractal somewhere in their name.
Filters graphs by date range- they must have been uploaded to Desmosearch (not Desmos!) after the value of upload_date_start and before the value of upload_date_end. These parameters- if included- must be Unix Timestamps!
Determines the means by which results are sorted. Can be one of id, parent_id, name, creator, or upload_date.