# Differences between new and legacy API

A summary of differences between the new and legacy API can be found in the table below. For more detailed information on differences regarding the Python API client.

|                                                      | New API                                                                                    | Legacy API                                                                                |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
| **Currently recommended for**                        | Early adopters                                                                             | Everyone else                                                                             |
| **Base URL**                                         | api.materialsproject.org                                                                   | materialsproject.org/rest/v2                                                              |
| **Documentation**                                    | [api.materialsproject.org/docs](https://api.materialsproject.org/docs)                     | [mapidoc](https://github.com/materialsproject/mapidoc)                                    |
| **Specification**                                    | [OpenAPI-compliant specification available](https://api.materialsproject.org/openapi.json) | None available                                                                            |
| **Support**                                          | Our new API will be supported for the forseeable future once released                      | Will be available for at least one year after new API is finalized                        |
| **Data Updates**                                     | Will receive new data updates included latest and most accurate data                       | Will be frozen at database release v2021.03.13                                            |
| **API Key**                                          | [Available here](https://next-gen.materialsproject.org/api#api-key)                        | Available at [legacy.materialsproject.org/open](https://legacy.materialsproject.org/open) |
| **Python client installation**                       | `pip install mp-api` (may be available in *pymatgen* at a later date)                      | `pip install pymatgen`                                                                    |
| **Python client import code**                        | `from mp_api.client import MPRester`                                                       | `from pymatgen.ext.matproj import MPRester`                                               |
| **MPContribs integration for user contributed data** | Yes                                                                                        | No                                                                                        |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.materialsproject.org/downloading-data/differences-between-new-and-legacy-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
