API Documentation

Programmatic access to sustainability data

RESTful API

Standard REST endpoints for accessing sustainability metrics, country data, and AI insights.

No Auth Required

Free access to all endpoints. Rate limiting applies: 1000 requests per hour per IP.

Real-time Data

Access the same data powering our web interface with millisecond response times.

Base URL

https://sustainabilityportal.org/api

All API endpoints are relative to this base URL. Responses are in JSON format.

Available Endpoints
GET/api/countries

Get list of all countries with sustainability data

Returns: Array of country names
GET/api/data/filter

Filter sustainability data by country, year, region

Example: ?country=Brazil&year=2018&region=South%20America
Returns: Filtered dataset array
GET/api/insights

Get AI-generated insights for dataset

Example: ?country=Brazil&metrics=carbon,renewable
Returns: AI insights object with recommendations
GET/api/stats

Get aggregated statistics for filtered data

Returns: Statistics object with averages and totals
Code Examples

Get Brazil Data

curl -X GET "https://sustainabilityportal.org/api/data/filter?country=Brazil"

JavaScript Fetch

fetch('/api/data/filter?country=Brazil&year=2018')
  .then(response => response.json())
  .then(data => console.log(data));

Python Request

import requests

url = "https://sustainabilityportal.org/api/data/filter"
params = {"country": "Brazil", "year": "2018"}
response = requests.get(url, params=params)
data = response.json()
Response Format

All API responses follow a consistent format:

{
  "success": true,
  "data": [...],
  "meta": {
    "total": 3287,
    "filtered": 152,
    "countries": 173,
    "years": "2000-2018"
  },
  "timestamp": "2024-12-01T10:30:00Z"
}
Error Handling
400 Bad Request

Invalid parameters or malformed request

429 Too Many Requests

Rate limit exceeded (1000 requests/hour)

500 Internal Server Error

Server error - please try again later

Support & Contact

Need help with API integration or have questions?

Developer Support: api@sustainabilityportal.org

Documentation: docs.sustainabilityportal.org

Status Page: status.sustainabilityportal.org

API Version 1.0 | Last updated: June 2025