Skip to content

Opendatasoft

Any Opendatasoft (Huwise) portal's catalog and records as SQL, with ODSQL pushdown

Connector software
Free and open source
Service credentials
Optional
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/opendatasoft/index.md to help me query Opendatasoft with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

The ten most prolific publishers on the Paris open-data portal

Example output · captured
Connector release
v0.2.0
Engine
2.0.1
VGI protocol
3.4.0
SELECT publisher, count(*) AS datasets, sum(records_count) AS records
FROM opendatasoft.main.datasets('opendata.paris.fr')
GROUP BY publisher
ORDER BY datasets DESC
LIMIT 10
Result · first 5 rows
publisher datasets records
Direction de la Voirie et des Déplacements - Ville de Paris 88 56,000,034
Direction de l'Urbanisme - Ville de Paris 87 1,813,446
Direction de la Démocratie, des Citoyen.ne.s et des Territoires - Ville de Paris 84 597,533
Direction des Finances et des Achats - Ville de Paris 30 688,420
Direction des Solidarités (DSOL) 30 157,758

Quick start

Choose where to run Opendatasoft, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'opendatasoft' AS opendatasoft (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-opendatasoft-worker'
);

3. Add service credentials (optional)

Public portals need no credentials; a key is only for private datasets. Replace the placeholders with your service settings.

opendatasoft credentials

Opendatasoft API key for private datasets; scope it to the portal URL.

Get these credentials →
secret.sql
CREATE SECRET opendatasoft (
    TYPE opendatasoft,
    apikey '<OPENDATASOFT_APIKEY>'  -- secret
);
Credential fields and requirements →

4. Run a query

query.sql
SELECT publisher, count(*) AS datasets, sum(records_count) AS records
FROM opendatasoft.main.datasets('opendata.paris.fr')
GROUP BY publisher
ORDER BY datasets DESC
LIMIT 10
More example queries →
Technical details
Verified connector release
v0.2.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'opendatasoft' AS opendatasoft (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-opendatasoft-worker'
);

Overview

Any Opendatasoft (Huwise) open-data portal as SQL: search dataset catalogs and read typed records, with filters, projections and aggregates pushed down as ODSQL. No API key needed for public data.

Catalog

Everything opendatasoft exposes once attached — read straight from the worker's released build.

opendatasoft 1 schema
main 6 functions

Opendatasoft catalog discovery and dataset records.

Schema examples (12)
Examples (12)

The ten most prolific publishers on the Paris open-data portal

SELECT publisher, count(*) AS datasets, sum(records_count) AS records
FROM opendatasoft.main.datasets('opendata.paris.fr')
GROUP BY publisher
ORDER BY datasets DESC
LIMIT 10;
Result · first 5 rows
publisher datasets records
Direction de la Voirie et des Déplacements - Ville de Paris 88 56,000,034
Direction de l'Urbanisme - Ville de Paris 87 1,813,446
Direction de la Démocratie, des Citoyen.ne.s et des Territoires - Ville de Paris 84 597,533
Direction des Finances et des Achats - Ville de Paris 30 688,420
Direction des Solidarités (DSOL) 30 157,758

Recently updated population datasets with more than 1,000 records

SELECT dataset_id, title, records_count
FROM opendatasoft.main.datasets('public.opendatasoft.com', q := 'population')
WHERE modified >= TIMESTAMPTZ '2025-01-01' AND records_count > 1000
ORDER BY records_count DESC;

The columns of the Paris arrondissements dataset and their types

SELECT name, label, ods_type, duckdb_type
FROM opendatasoft.main.fields('opendata.paris.fr', 'arrondissements')
ORDER BY position;

Which GeoNames fields can be used as facets

SELECT name
FROM opendatasoft.main.fields('public.opendatasoft.com', 'geonames-all-cities-with-a-population-1000')
WHERE is_facet
ORDER BY position;
8 more examples

How many Paris datasets each theme has

SELECT value AS theme, count AS datasets
FROM opendatasoft.main.facets('opendata.paris.fr', facet := 'theme')
ORDER BY count DESC;

Countries with the most cities above 1,000 inhabitants, counted by the portal

SELECT value AS country, count AS cities
FROM opendatasoft.main.facets('public.opendatasoft.com', dataset_id := 'geonames-all-cities-with-a-population-1000', facet := 'cou_name_en')
ORDER BY count DESC
LIMIT 10;

Name and area of Paris's first four arrondissements

SELECT l_aroff AS arrondissement, round(surface / 1000000, 2) AS km2
FROM opendatasoft.main.records('opendata.paris.fr', 'arrondissements')
WHERE c_ar <= 4
ORDER BY c_ar;

The five most populous French cities, sorted and limited by the portal

SELECT name, population, coordinates.lat, coordinates.lon
FROM opendatasoft.main.records('public.opendatasoft.com', 'geonames-all-cities-with-a-population-1000')
WHERE country_code = 'FR'
ORDER BY population DESC
LIMIT 5;

The ten countries with the largest population living in GeoNames cities

SELECT country, cities, population
FROM opendatasoft.main.odsql('public.opendatasoft.com', 'geonames-all-cities-with-a-population-1000', 'cou_name_en AS country, count(*) AS cities, sum(population) AS population', group_by := 'cou_name_en', order_by := 'population DESC', max_rows := 10);

Number of Paris arrondissements and their total area in square kilometres

SELECT arrondissements, round(km2, 1) AS km2
FROM opendatasoft.main.odsql('opendata.paris.fr', 'arrondissements', 'count(*) AS arrondissements, sum(surface) / 1000000 AS km2');

Quote a value containing quotes for an ODSQL condition

SELECT opendatasoft.main.odsql_quote('O''Brien "Jr"') AS literal;

Use a quoted literal inside a raw ODSQL filter

SELECT dataset_id
FROM opendatasoft.main.datasets('opendata.paris.fr', filter := 'publisher = ' || opendatasoft.main.odsql_quote('Airparif'))
ORDER BY dataset_id;
Scalar functions
odsql_quote (value VARCHAR) 3 examples

Quote text as an ODSQL string literal for filter := conditions

Arguments
value VARCHAR
Text to quote; NULL in, NULL out.
ReturnsVARCHAR
Examples (3)

Quote a value containing quotes for an ODSQL condition

SELECT opendatasoft.main.odsql_quote('O''Brien "Jr"') AS literal;

Use a quoted literal inside a raw ODSQL filter

SELECT dataset_id
FROM opendatasoft.main.datasets('opendata.paris.fr', filter := 'publisher = ' || opendatasoft.main.odsql_quote('Airparif'))
ORDER BY dataset_id;
SELECT 'publisher = ' || opendatasoft.main.odsql_quote(p) AS condition
FROM (VALUES ('Airparif'), ('Ville de Paris')) t(p)
ORDER BY p;
Link
Table functions
datasets (portal VARCHAR, filter := VARCHAR, keyword := VARCHAR, q := VARCHAR, refine := VARCHAR, theme := VARCHAR) 2 examples

Datasets published on an Opendatasoft portal, with ODSQL filter pushdown

Positional arguments
portal VARCHAR
The Opendatasoft portal: a domain such as 'opendata.paris.fr', 'public.opendatasoft.com' or 'data.opendatasoft.com', or an https:// URL (a pasted dataset page URL is trimmed to the portal root).
Named arguments
filter := VARCHAR
Raw ODSQL condition on catalog fields, e.g. 'records_count > 1000'. · default null
keyword := VARCHAR
Only datasets with this keyword (exact facet value). · default null
q := VARCHAR
Full-text search over the catalog, e.g. 'velo'. · default null
refine := VARCHAR
Raw facet refinement 'facet:value', e.g. 'publisher:Airparif'. · default null
theme := VARCHAR
Only datasets with this theme (exact facet value). · default null
Returns columns
portal VARCHAR
Base URL of the portal the dataset belongs to, e.g. https://opendata.paris.fr.
dataset_id VARCHAR
Dataset identifier, the key for records(), fields() and facets().
dataset_uid VARCHAR
Immutable internal dataset uid (da_xxxxxx).
title VARCHAR
Dataset title.
description VARCHAR
Dataset description as plain text (HTML tags removed).
publisher VARCHAR
Organization that publishes the dataset.
themes VARCHAR[]
Themes (categories) assigned to the dataset.
keywords VARCHAR[]
Free keywords assigned to the dataset.
license VARCHAR
License name, e.g. 'Open Database License (ODbL)'.
license_url VARCHAR
URL of the license text.
language VARCHAR
Metadata language code, e.g. 'fr'.
territory VARCHAR[]
Geographic coverage labels.
records_count BIGINT
Number of records in the dataset.
modified TIMESTAMPTZ
When the dataset was last modified (UTC).
data_processed TIMESTAMPTZ
When the data was last processed (UTC).
metadata_processed TIMESTAMPTZ
When the metadata was last processed (UTC).
features VARCHAR[]
Dataset features, e.g. geo, timeserie, analyze.
has_records BOOLEAN
True when the dataset has queryable records.
url VARCHAR
The dataset's page on the portal.
api_url VARCHAR
The Explore API v2.1 URL of the dataset.
Examples (2)

The ten most prolific publishers on the Paris open-data portal

SELECT publisher, count(*) AS datasets, sum(records_count) AS records
FROM opendatasoft.main.datasets('opendata.paris.fr')
GROUP BY publisher
ORDER BY datasets DESC
LIMIT 10;
Result · first 5 rows
publisher datasets records
Direction de la Voirie et des Déplacements - Ville de Paris 88 56,000,034
Direction de l'Urbanisme - Ville de Paris 87 1,813,446
Direction de la Démocratie, des Citoyen.ne.s et des Territoires - Ville de Paris 84 597,533
Direction des Finances et des Achats - Ville de Paris 30 688,420
Direction des Solidarités (DSOL) 30 157,758

Recently updated population datasets with more than 1,000 records

SELECT dataset_id, title, records_count
FROM opendatasoft.main.datasets('public.opendatasoft.com', q := 'population')
WHERE modified >= TIMESTAMPTZ '2025-01-01' AND records_count > 1000
ORDER BY records_count DESC;
Link
facets (portal VARCHAR, dataset_id := VARCHAR, facet := VARCHAR, filter := VARCHAR, q := VARCHAR, refine := VARCHAR) 2 examples

Facet value counts (themes, publishers, keywords, or a dataset's facet fields)

Positional arguments
portal VARCHAR
The Opendatasoft portal: a domain such as 'opendata.paris.fr', 'public.opendatasoft.com' or 'data.opendatasoft.com', or an https:// URL (a pasted dataset page URL is trimmed to the portal root).
Named arguments
dataset_id := VARCHAR
Count a dataset's records by facet; omit for catalog facets. · default null
facet := VARCHAR
Only this facet (any field name for datasets), e.g. 'publisher'. · default null
filter := VARCHAR
Raw ODSQL condition applied before counting. · default null
q := VARCHAR
Full-text search applied before counting. · default null
refine := VARCHAR
Facet refinement 'facet:value'. · default null
Returns columns
portal VARCHAR
Portal queried.
dataset_id VARCHAR
Dataset whose records were counted; NULL for catalog facets.
facet VARCHAR
Facet name, e.g. theme, publisher, keyword or a dataset field.
value VARCHAR
Facet value (use it in refine := 'facet:value').
label VARCHAR
Display name of the value.
count BIGINT
Number of datasets (catalog) or records (dataset) with this value.
state VARCHAR
Facet state: displayed, refined or excluded.
depth INTEGER
0 for top-level values; deeper for hierarchical facets.
path VARCHAR
Full hierarchical path, values joined by '/'.
Examples (2)

How many Paris datasets each theme has

SELECT value AS theme, count AS datasets
FROM opendatasoft.main.facets('opendata.paris.fr', facet := 'theme')
ORDER BY count DESC;

Countries with the most cities above 1,000 inhabitants, counted by the portal

SELECT value AS country, count AS cities
FROM opendatasoft.main.facets('public.opendatasoft.com', dataset_id := 'geonames-all-cities-with-a-population-1000', facet := 'cou_name_en')
ORDER BY count DESC
LIMIT 10;
Link
fields (portal VARCHAR, dataset_id VARCHAR) 2 examples

The fields (schema) of an Opendatasoft dataset with their DuckDB column types

Arguments
portal VARCHAR
The Opendatasoft portal: a domain such as 'opendata.paris.fr', 'public.opendatasoft.com' or 'data.opendatasoft.com', or an https:// URL (a pasted dataset page URL is trimmed to the portal root).
dataset_id VARCHAR
Dataset identifier as shown by datasets() or in the portal URL /explore/dataset/<dataset_id>/, e.g. 'arrondissements'.
Returns columns
portal VARCHAR
Portal the dataset belongs to.
dataset_id VARCHAR
Dataset identifier.
position INTEGER
1-based position of the field in the dataset schema.
name VARCHAR
Field name: the column name in records() and in ODSQL.
label VARCHAR
Human-readable field label.
description VARCHAR
Field description, when the publisher wrote one.
ods_type VARCHAR
Opendatasoft type: text, int, double, date, datetime, geo_point_2d, ...
duckdb_type VARCHAR
The DuckDB type of the column in records().
multivalued_separator VARCHAR
Separator of a multivalued text field (then a VARCHAR[] column).
is_facet BOOLEAN
True when the field is a facet (usable with facets() and refine :=).
is_sortable BOOLEAN
True when the publisher marked the field sortable.
is_id BOOLEAN
True when the field is marked as the record identifier.
annotations JSON
All field annotations as JSON.
Examples (2)

The columns of the Paris arrondissements dataset and their types

SELECT name, label, ods_type, duckdb_type
FROM opendatasoft.main.fields('opendata.paris.fr', 'arrondissements')
ORDER BY position;

Which GeoNames fields can be used as facets

SELECT name
FROM opendatasoft.main.fields('public.opendatasoft.com', 'geonames-all-cities-with-a-population-1000')
WHERE is_facet
ORDER BY position;
Link
odsql (portal VARCHAR, dataset_id VARCHAR, select VARCHAR, filter := VARCHAR, group_by := VARCHAR, max_rows := BIGINT, order_by := VARCHAR) 2 examples

Run a server-side ODSQL query (aggregates, group_by) on an Opendatasoft dataset

Positional arguments
portal VARCHAR
The Opendatasoft portal: a domain such as 'opendata.paris.fr', 'public.opendatasoft.com' or 'data.opendatasoft.com', or an https:// URL (a pasted dataset page URL is trimmed to the portal root).
dataset_id VARCHAR
Dataset identifier as shown by datasets() or in the portal URL /explore/dataset/<dataset_id>/, e.g. 'arrondissements'.
select VARCHAR
ODSQL select list, e.g. 'cou_name_en, count(*) AS n, sum(population) AS pop'.
Named arguments
filter := VARCHAR
ODSQL where condition, e.g. 'population > 1000000'. · default null
group_by := VARCHAR
ODSQL group_by, e.g. 'cou_name_en' or 'year(date) AS y'. · default null
max_rows := BIGINT
Most rows to return: up to 20,000 with group_by, 10,000 without. · default 1000
order_by := VARCHAR
ODSQL order_by, e.g. 'n DESC'. · default null
Returns columns
<selected dataset field> VARCHAR
A selected or grouped field keeps its fields() type.
<alias of count(*)> BIGINT
Integer results.
<alias of sum / avg / ...> DOUBLE
Fractional results.
<alias of max(datetime) ...> TIMESTAMPTZ
Timestamp results.
<alias of max(date) ...> DATE
Date results.
<other alias> VARCHAR
Text results.
<nested alias> JSON
Nested values.
cou_name_en VARCHAR
The group key, echoed by the portal.
country VARCHAR
Alias of cou_name_en.
cities BIGINT
count(*).
population BIGINT
sum(population).
arrondissements BIGINT
count(*).
km2 DOUBLE
sum(surface) / 1000000.
Returns columns · depends on the arguments
<selected dataset field> VARCHAR
A selected or grouped field keeps its fields() type.
<alias of count(*)> BIGINT
Integer results.
<alias of sum / avg / ...> DOUBLE
Fractional results.
<alias of max(datetime) ...> TIMESTAMPTZ
Timestamp results.
<alias of max(date) ...> DATE
Date results.
<other alias> VARCHAR
Text results.
<nested alias> JSON
Nested values.
cou_name_en VARCHAR
The group key, echoed by the portal.
country VARCHAR
Alias of cou_name_en.
cities BIGINT
count(*).
population BIGINT
sum(population).
arrondissements BIGINT
count(*).
km2 DOUBLE
sum(surface) / 1000000.
Examples (2)

The ten countries with the largest population living in GeoNames cities

SELECT country, cities, population
FROM opendatasoft.main.odsql('public.opendatasoft.com', 'geonames-all-cities-with-a-population-1000', 'cou_name_en AS country, count(*) AS cities, sum(population) AS population', group_by := 'cou_name_en', order_by := 'population DESC', max_rows := 10);

Number of Paris arrondissements and their total area in square kilometres

SELECT arrondissements, round(km2, 1) AS km2
FROM opendatasoft.main.odsql('opendata.paris.fr', 'arrondissements', 'count(*) AS arrondissements, sum(surface) / 1000000 AS km2');
Link
records (portal VARCHAR, dataset_id VARCHAR, filter := VARCHAR, q := VARCHAR, refine := VARCHAR) 2 examples

Rows of one Opendatasoft dataset, typed from its schema, with ODSQL pushdown

Positional arguments
portal VARCHAR
The Opendatasoft portal: a domain such as 'opendata.paris.fr', 'public.opendatasoft.com' or 'data.opendatasoft.com', or an https:// URL (a pasted dataset page URL is trimmed to the portal root).
dataset_id VARCHAR
Dataset identifier as shown by datasets() or in the portal URL /explore/dataset/<dataset_id>/, e.g. 'arrondissements'.
Named arguments
filter := VARCHAR
Extra raw ODSQL condition, e.g. 'distance(geo, geom\'POINT(2.35 48.85)\', 1km)'. · default null
q := VARCHAR
Full-text search over the dataset's text fields. · default null
refine := VARCHAR
Facet refinement 'facet:value', e.g. 'c_ar:4'. · default null
Returns columns
<int field> BIGINT
Integer field.
<double / decimal field> DOUBLE
Numeric field.
<date field> DATE
Calendar date.
<datetime field> TIMESTAMPTZ
Timestamp, UTC.
<boolean field> BOOLEAN
Boolean field.
<geo_point_2d field> STRUCT(lon DOUBLE, lat DOUBLE)
WGS84 point.
<geo_shape field> JSON
GeoJSON geometry (use ST_GeomFromGeoJSON).
<json_blob field> JSON
Free-form JSON.
<file field> STRUCT of 8 fields
Attached file.
STRUCT 8 fields
  • idVARCHAR
  • filenameVARCHAR
  • formatVARCHAR
  • urlVARCHAR
  • widthINTEGER
  • heightINTEGER
  • thumbnailBOOLEAN
  • color_summaryVARCHAR[]
<multivalued text field> VARCHAR[]
List of values.
<text field> VARCHAR
Text and any other type.
n_sq_ar BIGINT
Identifiant séquentiel de l’arrondissement (int)
c_ar BIGINT
Numéro d’arrondissement (int)
c_arinsee BIGINT
Numéro d’arrondissement INSEE (int)
l_ar VARCHAR
Nom de l’arrondissement (text)
l_aroff VARCHAR
Nom officiel de l’arrondissement (text)
n_sq_co BIGINT
N_SQ_CO (int)
surface DOUBLE
Surface (double)
perimetre DOUBLE
Périmètre (double)
geom_x_y STRUCT(lon DOUBLE, lat DOUBLE)
Geometry X Y (geo_point_2d)
geom JSON
Geometry (geo_shape)
geoname_id VARCHAR
Geoname ID (text)
name VARCHAR
Name (text)
ascii_name VARCHAR
ASCII Name (text)
alternate_names VARCHAR[]
Alternate Names (text)
feature_class VARCHAR
Feature Class (text)
feature_code VARCHAR
Feature Code (text)
country_code VARCHAR
Country Code (text)
cou_name_en VARCHAR
Country name EN (text)
country_code_2 VARCHAR
Country Code 2 (text)
admin1_code VARCHAR
Admin1 Code (text)
admin2_code VARCHAR
Admin2 Code (text)
admin3_code BIGINT
Admin3 Code (int)
admin4_code VARCHAR
Admin4 Code (text)
population BIGINT
Population (int)
elevation VARCHAR
Elevation (text)
dem BIGINT
DIgital Elevation Model (int)
timezone VARCHAR
Timezone (text)
modification_date DATE
Modification date (date)
label_en VARCHAR
LABEL EN (text)
coordinates STRUCT(lon DOUBLE, lat DOUBLE)
Coordinates (geo_point_2d)
Returns columns · depends on the arguments
<int field> BIGINT
Integer field.
<double / decimal field> DOUBLE
Numeric field.
<date field> DATE
Calendar date.
<datetime field> TIMESTAMPTZ
Timestamp, UTC.
<boolean field> BOOLEAN
Boolean field.
<geo_point_2d field> STRUCT(lon DOUBLE, lat DOUBLE)
WGS84 point.
<geo_shape field> JSON
GeoJSON geometry (use ST_GeomFromGeoJSON).
<json_blob field> JSON
Free-form JSON.
<file field> STRUCT of 8 fields
Attached file.
STRUCT 8 fields
  • idVARCHAR
  • filenameVARCHAR
  • formatVARCHAR
  • urlVARCHAR
  • widthINTEGER
  • heightINTEGER
  • thumbnailBOOLEAN
  • color_summaryVARCHAR[]
<multivalued text field> VARCHAR[]
List of values.
<text field> VARCHAR
Text and any other type.
n_sq_ar BIGINT
Identifiant séquentiel de l’arrondissement (int)
c_ar BIGINT
Numéro d’arrondissement (int)
c_arinsee BIGINT
Numéro d’arrondissement INSEE (int)
l_ar VARCHAR
Nom de l’arrondissement (text)
l_aroff VARCHAR
Nom officiel de l’arrondissement (text)
n_sq_co BIGINT
N_SQ_CO (int)
surface DOUBLE
Surface (double)
perimetre DOUBLE
Périmètre (double)
geom_x_y STRUCT(lon DOUBLE, lat DOUBLE)
Geometry X Y (geo_point_2d)
geom JSON
Geometry (geo_shape)
geoname_id VARCHAR
Geoname ID (text)
name VARCHAR
Name (text)
ascii_name VARCHAR
ASCII Name (text)
alternate_names VARCHAR[]
Alternate Names (text)
feature_class VARCHAR
Feature Class (text)
feature_code VARCHAR
Feature Code (text)
country_code VARCHAR
Country Code (text)
cou_name_en VARCHAR
Country name EN (text)
country_code_2 VARCHAR
Country Code 2 (text)
admin1_code VARCHAR
Admin1 Code (text)
admin2_code VARCHAR
Admin2 Code (text)
admin3_code BIGINT
Admin3 Code (int)
admin4_code VARCHAR
Admin4 Code (text)
population BIGINT
Population (int)
elevation VARCHAR
Elevation (text)
dem BIGINT
DIgital Elevation Model (int)
timezone VARCHAR
Timezone (text)
modification_date DATE
Modification date (date)
label_en VARCHAR
LABEL EN (text)
coordinates STRUCT(lon DOUBLE, lat DOUBLE)
Coordinates (geo_point_2d)
Examples (2)

Name and area of Paris's first four arrondissements

SELECT l_aroff AS arrondissement, round(surface / 1000000, 2) AS km2
FROM opendatasoft.main.records('opendata.paris.fr', 'arrondissements')
WHERE c_ar <= 4
ORDER BY c_ar;

The five most populous French cities, sorted and limited by the portal

SELECT name, population, coordinates.lat, coordinates.lon
FROM opendatasoft.main.records('public.opendatasoft.com', 'geonames-all-cities-with-a-population-1000')
WHERE country_code = 'FR'
ORDER BY population DESC
LIMIT 5;
Link

Credentials

The secret type opendatasoft declares, as reported by the worker itself.

opendatasoft

How to get these credentials

Opendatasoft API key for private datasets; scope it to the portal URL.

secret.sql
CREATE SECRET opendatasoft (
    TYPE opendatasoft,
    apikey '<OPENDATASOFT_APIKEY>'  -- secret
);
Key Type Required Description
apikey secret VARCHAR — API key from the portal's account settings, sent as 'Authorization: Apikey ...'.

The worker doesn't mark which keys are required.

Create the secret in the same session, after attaching opendatasoft — the worker registers its secret types at ATTACH. Keys marked secret are masked in duckdb_secrets(); angle-bracket values are placeholders. Read credentials from your environment or secret store in your application and pass them through your SQL client’s parameter bindings. Keep real values out of saved SQL and history. Native DuckDB and Haybarn do not provide a SQL getenv() function.

Try these queries

Recently updated population datasets with more than 1,000 records

SELECT dataset_id, title, records_count
FROM opendatasoft.main.datasets('public.opendatasoft.com', q := 'population')
WHERE modified >= TIMESTAMPTZ '2025-01-01' AND records_count > 1000
ORDER BY records_count DESC

Uses datasets

The columns of the Paris arrondissements dataset and their types

SELECT name, label, ods_type, duckdb_type
FROM opendatasoft.main.fields('opendata.paris.fr', 'arrondissements')
ORDER BY position

Uses fields

How many Paris datasets each theme has

SELECT value AS theme, count AS datasets
FROM opendatasoft.main.facets('opendata.paris.fr', facet := 'theme')
ORDER BY count DESC

Uses facets

Name and area of Paris's first four arrondissements

SELECT l_aroff AS arrondissement, round(surface / 1000000, 2) AS km2
FROM opendatasoft.main.records('opendata.paris.fr', 'arrondissements')
WHERE c_ar <= 4
ORDER BY c_ar

Uses records

The ten countries with the largest population living in GeoNames cities

SELECT country, cities, population
FROM opendatasoft.main.odsql('public.opendatasoft.com', 'geonames-all-cities-with-a-population-1000', 'cou_name_en AS country, count(*) AS cities, sum(population) AS population', group_by := 'cou_name_en', order_by := 'population DESC', max_rows := 10)

Uses odsql

Quote a value containing quotes for an ODSQL condition

SELECT opendatasoft.main.odsql_quote('O''Brien "Jr"') AS literal

Uses odsql_quote

6 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Using the Opendatasoft worker and the 'arrondissements' dataset on opendata.paris.fr, how many arrondissements does Paris have?
  • Which Paris arrondissement (official name, column l_aroff) has the largest surface according to the 'arrondissements' dataset on opendata.paris.fr?
  • On the opendata.paris.fr portal, how many datasets carry each theme?
  • List the dataset ids that the publisher 'Airparif' has on the opendata.paris.fr portal.
  • What Opendatasoft type does the field 'geom' have in the 'arrondissements' dataset on opendata.paris.fr?
  • Quote the text O'Brien "Jr" as an ODSQL string literal with the Opendatasoft worker.

Opendatasoft is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.