Skip to content
EN

Using Public API (Read)

Last updated

This page walks you through making CMS data available via Public API and completing your first request.

To retrieve data with Public API, you need to make two settings in the Re:Earth CMS management console.

  1. Set an item’s status to published
  2. Enable the model on the Reading tab of the Public API page

In the Re:Earth CMS management console, change the status of the item you want to publish to Published.

To make a model’s data retrievable via Public API, you need to enable that model on the Reading tab of the Public API page.

  1. Open the project’s Public API page

  2. Select the Reading tab

  3. Turn on the Enable toggle for the target model

  4. Click the Save Changes button

    Re:Earth CMS's Public API page, with the Reading tab selected, the target model's Enable toggle turned on, and the Save Changes button active. The API Key list and New Key button are shown below.

The API Key section is further down the same Public API page: the next section, “Set up an API key,” is done from there.

3. Set up an API key (private projects only, optional)

Section titled “3. Set up an API key (private projects only, optional)”

If the project’s visibility is private, you can control access by issuing an API key. Public projects don’t need an API key.

Setup steps:

  1. Open the project’s Public API page

  2. Click the + New Key button in the API Key section

  3. Enter a name and description, set Permissions for the target models, and click Save Changes

    Re:Earth CMS's Public API / New API Key page, showing the Name and Description fields, a Permissions table with an Enable toggle for each model, and a Save Changes button below.
  4. The new API key is added to the API Key section. Copy it to use it with your external application

    Hovering over the copy icon in the API Key list, showing the Copy tooltip.

Attach the issued API key to the Authorization header of your requests.

Terminal window
curl 'https://api.cms.reearth.io/api/p/<workspace>/<project>/<model>' \
-H 'Authorization: Bearer <your_api_key>'

Once your publishing settings are in place, you can retrieve a list of items from the following URL. No API key is needed for public data. Replace the angle-bracketed placeholders such as <workspace_id_or_alias> with your actual values.

GET https://api.cms.reearth.io/api/p/<workspace_id_or_alias>/<project_id_or_alias>/<model_id_or_key>
Terminal window
curl --location --request GET \
'https://api.cms.reearth.io/api/p/<workspace_id_or_alias>/<project_id_or_alias>/<model_id_or_key>'