{ "cells": [ { "cell_type": "markdown", "id": "5694c920-c12c-40b6-bf05-c7a48ea9598e", "metadata": {}, "source": [ "# Simple examples - Statistics\n", "\n", "This notebook is just a small reference on how to request OSM statistics via the ohsome-API.\n", "\n", "Statistics:\n", "- features length for single timestamp\n", "- features count for time series\n", "- contributors count for time bins\n", "- contributions count for time bins\n" ] }, { "cell_type": "code", "execution_count": 1, "id": "2ecc8374-d973-4ee5-857b-926065328367", "metadata": {}, "outputs": [], "source": [ "import os\n", "from io import StringIO\n", "\n", "import httpx\n", "import matplotlib.pyplot as plt\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "id": "634573b8-f011-4b89-a7e7-725372497e9e", "metadata": {}, "outputs": [], "source": [ "OHSOME_API_URL = os.getenv(\"OHSOME_API_URL\", \"https://api.heigit.org/ohsome-api/v2-rc\")\n", "OHSOME_API_KEY = os.getenv(\n", " \"OHSOME_API_KEY\", \"\"\n", ") # insert your api key as env or default value here" ] }, { "cell_type": "markdown", "id": "616e834a-cd95-4c8b-9d1c-aa92699ade32", "metadata": {}, "source": [ "## Features Length Single Timestamp" ] }, { "cell_type": "code", "execution_count": 3, "id": "17be47f3-f1e6-4187-86c3-5f42b3e10047", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | timestamp | \n", "value | \n", "
|---|---|---|
| 0 | \n", "2026-08-21T21:59:59Z | \n", "242452 | \n", "