PetroDB REST API

About the API

The PetroDB REST API provides access to petrological project management and analytical data. It offers endpoints to manage users, projects, samples, analytical spots, areas, and profiles. Authentication is handled via OAuth2 password flow.

Explore API Endpoints →

Authentication

The API uses OAuth2 Password Flow for authentication. Obtain a token using the /token endpoint:

POST /token
Content-Type: application/x-www-form-urlencoded

grant_type=password
username=your_username
password=your_password
    

Use the received access_token as a Bearer token in subsequent requests.

Available API Modules

Users

Endpoints for user creation and management (admin only).

Projects

Manage geological projects and associated users.

Samples

Manage rock or mineral samples under projects.

Spots

Endpoints for analytical spot data management.

Areas

Endpoints to store and manage analytical area results.

Profiles & Profile Spots

Profiles represent analytical traverses; profile spots are measured points.

Search

Search for projects, samples, or analytical data by attributes.