GET /
200 OK

The homepage of the EcoMetrics API application. Provides an overview and demo visualizations.

Open in New Tab
Response Preview
GET /querybuilder
200 OK

Interactive query builder interface. Create API queries visually and preview responses in real-time.

Open in New Tab
Response Preview
GET /table
200 OK

Returns a formatted HTML table of population, GDP per capita, or forest area data with customizable pivot options.

Parameters

Region string | array

Country or list of countries to include in the table.

  • Single: "India"
  • Multiple: ["India","China"]
Year number | array | string

Year(s) to include in the data.

  • Single: 2000
  • Array: [2000,2001,2010]
  • Range: "2000,2010,2" (start,stop,step)
Pivot string

Determines the table axis orientation.

  • Year - Years as columns
  • Region - Countries as columns
Query_type string

Type of data to retrieve.

  • population
  • gdp_per_capita
  • forest_area
Open in New Tab
Response Preview
GET /json
200 OK

Returns raw JSON data for programmatic use. Ideal for development and machine learning applications.

Parameters

Region string | array

Country or list of countries to include.

Year number | array | string

Year(s) to include in the data.

Pivot string

Determines JSON structure. If Year or Region is selected, they become the object keys.

  • None - Flat structure
  • Year - Grouped by year
  • Region - Grouped by country
Query_type string

Type of data to retrieve.

  • population
  • gdp_per_capita
  • forest_area
Open in New Tab
Response Preview
GET /graph
200 OK

Returns interactive graphs comparing data across countries and years with customizable themes and plot types.

Parameters

Region string | array

Country or list of countries to include.

Year number | array | string

Year(s) to include in the graph.

Query_type string

Type of data to visualize.

  • population
  • gdp_per_capita
  • forest_area
Plot string

Type of chart to generate.

  • scatter - Scatter plot
  • bar - Bar chart
Theme string

Visual theme for the graph.

  • none, fluorescent, light
  • blackpink, dark, aquamarine
Open in New Tab
Response Preview
GET /stats
200 OK

Returns pie charts comparing the top and bottom N countries for a given metric in a specific year.

Parameters

Year number

Single year between 1950-2021 to analyze.

Number number

Number of top and bottom countries to compare.

Query_type string

Type of data to compare.

  • population
  • gdp_per_capita
  • forest_area
Theme string

Visual theme for the chart.

  • none, fluorescent, light
  • blackpink, dark, aquamarine
Open in New Tab
Response Preview