API Documentation

The 4life.earth API provides programmatic access to citizen science project data and submissions. All endpoints return data in JSON, CSV, or GeoJSON formats for easy integration with external applications.

FAIR Data Principles

Findable

All data is accessible through standardized REST APIs with clear documentation and metadata.

Accessible

Data is freely available without authentication for public projects. Open access for research and education.

Interoperable

Multiple data formats (JSON, CSV, GeoJSON) ensure compatibility with various tools and platforms.

Reusable

Rich metadata and clear licensing enable data reuse for research, education, and policy development.

Privacy & Anonymity

Anonymous Access: All public data is available without authentication or personal information.

Data Protection: Personal identifiers are removed from public datasets. Only aggregated and anonymized data is exposed.

Open Science: Data is shared under open licenses to promote transparency and scientific collaboration.

Endpoints

GET

/api/observations

Retrieve recent observations from all projects or filtered by specific project

Parameters

ParameterTypeRequiredDescription
formatstringNoResponse format (json, csv, geojson)
project_idstringNoFilter by specific project ID or slug
boundsstringNoGeographic bounds (north,south,east,west)
coordinatesstringNoCenter point with radius (lat,lng,radius_km)
limitnumberNoNumber of observations to return (default: 100, max: 1000)
daysnumberNoFilter observations from last N days (default: 30)

Example Request

cURL
curl "https://4life.earth/api/observations?format=json&project_id=water-quality&coordinates=52.3676,4.9041,10&limit=50"

Example Response

JSON
{
  "observations": [
    {
      "id": "observation-id",
      "project_id": "project-id",
      "project_title": "Water Quality Monitoring",
      "data": {
        "water_temperature": 18.5,
        "ph_level": 7.2,
        "turbidity": 2.1
      },
      "location": {
        "lat": 52.3676,
        "lng": 4.9041,
        "address": "Amsterdam, Netherlands"
      },
      "status": "approved",
      "submitted_at": "2024-01-10T14:30:00Z",
      "type": "form_submission"
    }
  ],
  "metadata": {
    "total": 150,
    "filtered_by": {
      "project_id": "water-quality",
      "coordinates": [52.3676, 4.9041, 10],
      "days": 30
    },
    "format": "json",
    "generated_at": "2024-01-15T10:30:00Z"
  }
}
European Union

Funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or European Climate, Infrastructure, and Environment Executive Agency (CINEA). Neither the European Union nor the granting authority can be held responsible for them.

Restore4Life