Hi @inkcode. If you are accessing the API via the pymatgen library, the source code for the client is available here. Unfortunately, the source code for the server end is not open at this time. However, the method of searching for compounds that the main
MPRester.query uses is a simple dispatching to the strategy of the underlying MongoDB database. Compound information is compiled from various related calculations into JSON documents via open-source emmet builders, that are stored in MongoDB. You search using the JSON-based MongoDB pattern matching language, which the database uses to find the relevant material-compound documents, using a built-in query planner that uses awareness of indexes to determine the fastest strategy to page through records to find those that match your query. I hope this helps.