SDKs overview
Luchtmeetnet primarily serves as a public service providing air quality data for the Netherlands. Its core offering for programmatic access is a public API for data retrieval. Unlike many commercial platforms, Luchtmeetnet does not officially distribute Software Development Kits (SDKs) for specific programming languages. Instead, developers typically interact with the Luchtmeetnet API directly using standard HTTP client libraries available in their chosen language. This approach offers flexibility but requires developers to manage API requests, response parsing, and error handling manually.
The absence of official SDKs means there is no single, prescribed method for integrating Luchtmeetnet data. However, the API's design allows for straightforward consumption, enabling the development of custom wrappers or the use of community-contributed libraries. These community efforts often aim to simplify data fetching and processing, providing a more idiomatic interface for specific languages.
Developers working with Luchtmeetnet data often focus on retrieving historical and real-time measurements for various pollutants, such as particulate matter (PM10, PM2.5), nitrogen dioxide (NO2), and ozone (O3), from a network of monitoring stations throughout the Netherlands. The API supports queries based on location, time, and pollutant type.
Official SDKs by language
As of late 2026, Luchtmeetnet does not provide official, maintained SDKs for any programming language. Access to the Luchtmeetnet data is primarily facilitated through its RESTful API. Developers are expected to use generic HTTP client libraries to interact with this API. This model is common for public data services that prioritize broad accessibility over language-specific tooling, allowing developers to integrate data using any programming environment that can make HTTP requests.
The table below summarizes the current status regarding official SDKs:
| Language | Package Name | Installation Command | Maturity |
|---|---|---|---|
| Python | N/A | N/A | No official SDK |
| JavaScript/Node.js | N/A | N/A | No official SDK |
| Java | N/A | N/A | No official SDK |
| Ruby | N/A | N/A | No official SDK |
| PHP | N/A | N/A | No official SDK |
| Go | N/A | N/A | No official SDK |
| C#/.NET | N/A | N/A | No official SDK |
Installation
Since there are no official SDKs, installation involves setting up a basic HTTP client in your preferred programming language. The following examples demonstrate how to set up common HTTP clients, which are prerequisites for interacting with the Luchtmeetnet API.
Python
For Python, the requests library is a widely used and recommended HTTP client. It simplifies making HTTP requests.
pip install requests
JavaScript/Node.js
In Node.js environments, node-fetch (for browser-like fetch API) or axios are popular choices for making HTTP requests. For browser-based applications, the native fetch API can be used directly.
npm install node-fetch # or axios
Java
For Java, popular choices include the built-in java.net.http package (available since Java 11) or third-party libraries like Apache HttpClient or OkHttp. Using Maven, you might add a dependency for OkHttp:
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.3</version>
</dependency>
Ruby
Ruby applications can use the built-in Net::HTTP library or the more user-friendly httparty gem.
gem install httparty
PHP
PHP projects often use Guzzle, a robust HTTP client. Install via Composer:
composer require guzzlehttp/guzzle
Go
Go has a powerful built-in net/http package for making HTTP requests:
go mod init myluchtmeetnetapp
go get -u
No external dependencies needed for basic HTTP requests in Go.
Quickstart example
This quickstart demonstrates how to fetch the latest air quality measurements for a specific component (e.g., PM10) from the Luchtmeetnet API using Python and the requests library. This example assumes you have followed the installation steps for Python.
The Luchtmeetnet API provides various endpoints. For this example, we'll use an endpoint to retrieve current measurements. Consult the official Luchtmeetnet API documentation for specific endpoint details and available parameters.
Python Example: Fetching PM10 Data
import requests
import json
# Define the API endpoint for current measurements
# This is a hypothetical endpoint structure based on common API patterns.
# Always refer to the official Luchtmeetnet API documentation for actual endpoints and parameters.
api_base_url = "https://www.luchtmeetnet.nl/openluchtmeetnet/api/v1/" # Placeholder, check official docs
endpoint = f"{api_base_url}measurements/latest"
# Parameters for the request (example: filter by component 'PM10')
# Actual valid parameters will be listed in the Luchtmeetnet API documentation.
params = {
"component": "PM10",
"station_type": "all", # Example: 'urban', 'rural'
"limit": 5 # Get 5 latest measurements
}
try:
response = requests.get(endpoint, params=params)
response.raise_for_status() # Raise an exception for HTTP errors (4xx or 5xx)
data = response.json()
print("Successfully fetched data:")
print(json.dumps(data, indent=2))
# Example: Print specific data points
if data and isinstance(data, list):
for measurement in data:
station_name = measurement.get('station_name', 'N/A')
value = measurement.get('value', 'N/A')
unit = measurement.get('unit', 'N/A')
timestamp = measurement.get('timestamp', 'N/A')
print(f" Station: {station_name}, Value: {value} {unit}, Time: {timestamp}")
elif:
print(f"Error fetching data: {response.status_code} - {response.text}")
except requests.exceptions.RequestException as e:
print(f"An error occurred during the request: {e}")
except json.JSONDecodeError:
print("Failed to decode JSON response.")
except Exception as e:
print(f"An unexpected error occurred: {e}")
Note: The API endpoint (https://www.luchtmeetnet.nl/openluchtmeetnet/api/v1/) and parameter structure used in this quickstart are illustrative. Developers should consult the official Luchtmeetnet API documentation for the most up-to-date and accurate endpoint URLs, required authentication (if any), and available query parameters.
Community libraries
While Luchtmeetnet does not offer official SDKs, the open nature of its API has led to the development of several community-contributed libraries. These libraries typically wrap the HTTP API, providing a more convenient and language-idiomatic way to access the data. They often handle common tasks such as constructing URLs, making HTTP requests, parsing JSON responses, and converting data into native language objects.
The existence of community libraries reflects the developer interest in Luchtmeetnet's valuable public data. These projects vary in maturity, maintenance status, and the specific features they implement. Developers considering using a community library should verify its active maintenance, documentation, and compatibility with their project requirements. Searching platforms like GitHub or package repositories (e.g., PyPI for Python, CRAN for R) for "Luchtmeetnet" or "air quality Netherlands" can reveal available options.
Examples of types of community libraries that might exist include:
- Python wrappers: Libraries that provide functions to fetch data from specific Luchtmeetnet endpoints, returning pandas DataFrames or custom data objects.
- R packages: Tools for environmental data scientists to directly import Luchtmeetnet data into R for statistical analysis and visualization.
- JavaScript modules: Frontend or backend modules for integrating air quality data into web applications.
When using community libraries, it's important to attribute the original data source (Luchtmeetnet) and to be aware that community projects may not offer the same level of support or stability as official vendor-provided SDKs. Users of public data APIs, such as the Luchtmeetnet API, often build custom integrations or use generic HTTP client libraries as a robust and flexible alternative when official SDKs are not available.