Token导航 LogoToken导航

Agent Skill · 研究检索

datagouv-apis(数据管理 API)

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

datagouv-apis 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 62,606。

总安装 329周安装 14GitHub Stars 16下载 115核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:datagouv-apis(数据管理 API)
来源仓库:https://github.com/datagouv/datagouv-skill
仓库路径:skills/datagouv-apis
安装命令:
npx skills add https://github.com/datagouv/datagouv-skill --skill datagouv-apis
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/datagouv/datagouv-skill --skill datagouv-apis

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

访问 data.gouv.fr 开放数据平台的三大 HTTP API:主接口、指标和表格数据。支持外部 dataservices 的发现与调用,仅限读取除非明确授权写入操作。优先使用 MCP 工具进行对话式目录探索,提升元数据检索效率。调用第三方服务前应验证 API 密钥权限,防止越权访问敏感数据集。

datagouv-apis 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/datagouv-apis

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/datagouv/datagouv-skill --skill datagouv-apis;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

datagouv-apis 怎么安装?

在终端执行 npx skills add https://github.com/datagouv/datagouv-skill --skill datagouv-apis。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

datagouv-apis 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

datagouv-apis 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

datagouv-apis 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

datagouv-apis 用的人多吗?

公开数据是累计安装 329 次,近一周安装 14 次,下载 115 次,GitHub 16 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

datagouv-apis 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
datagouv-apis

数据管理 API · 本页

32916接触敏感数据未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

data.gouv.fr APIs — Consolidated Reference

Three HTTP APIs (Main, Metrics, Tabular) plus dataservices (external HTTP APIs described on the platform; they used to be referenced on api.gouv.fr and are now dataservices on data.gouv.fr). This file is consumption-first: read paths and discovery; writes only when the user explicitly wants them and an API key is available.


How to use this skill

  • MCP first: If the client exposes data.gouv.fr MCP tools, use them for conversational catalog exploration; they orchestrate the same platform capabilities with typed tool calls. For dataservices in particular, search_dataservices matches the intent of GET /dataservices/; after a hit, load the detail record (machine_documentation_url, base_api_url, etc.) via MCP or via GET /dataservices/{id}/ before calling the upstream API. Endpoint: https://mcp.data.gouv.fr/mcp. Repos: datagouv-mcp, datagouv-skill. Tool names vary by server version—follow the host’s tool list and fall back to the HTTP endpoints in this document when MCP is missing or insufficient (dataservices: GET https://www.data.gouv.fr/api/1/dataservices/ with q, filters, and next_page, then GET /dataservices/{id}/).
  • HTTP otherwise: Use the Main, Metrics, and Tabular base URLs below. Prefer GET responses over assumptions: do not invent dataset or resource IDs; cite slugs, UUIDs, and URLs returned by the API.
  • Automation vs chat: MCP suits interactive exploration; the Main API suits reproducible scripts and the full route surface.
  • Writes (atypical): Never log or echo X-API-KEY. Use POST/PUT/PATCH/DELETE only with clear user intent and a configured key. On 401/403, distinguish missing key from insufficient permissions; on 404, re-check id vs slug and use search. Do not expand into full producer pipelines here.

Choosing an API (intent → surface)

User goalUse
Search or read catalog metadata, resources, orgs, reuses, discussionsMain API — e.g. GET /datasets/, GET /datasets/{id}/, resources under the dataset
Filter/sort/paginate rows of a CSV resource hosted for TabularTabular API — after steps in §3 Tabular API
Platform usage / statistics (models such as dataset, organization, site)Metrics API — see Swagger for {model} and column filters
Call an external API (legacy catalog: api.gouv.fr; now dataservices on data.gouv.fr)Dataservices — MCP search_dataservices or GET /dataservices/, then machine_documentation_url + base_api_url (steps in §1 Main API)

Identifiers and catalog visibility

  • Technical UUID vs slug: Both work in many paths; prefer the UUID from API responses for stable automation.
  • Resolve before Tabular: Tabular {rid} is the resource UUID from GET /datasets/{id}/ (or .../resources/). If you only have a slug, GET the dataset first and read resources[].id.
  • Stable resource link: GET /datasets/r/{id}/ redirects to the latest resource for that id.
  • Search is not “the whole web”: GET /datasets/ supports filters such as archived, deleted, private. Defaults may hide some records; set query params explicitly when the user needs a full picture and the key allows it.

Pagination and rate limits

  • Lists return data, page, page_size, total, next_page, previous_page. Follow next_page until empty instead of guessing page counts.
  • Use a reasonable page_size; avoid hammering the service or downloading the entire catalog page by page without need.
  • Respect X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset: slow down or backoff when remaining is low.

Demo vs production

  • Production: https://www.data.gouv.fr/api/1/ (and production Metrics / Tabular hosts below).
  • Demo: https://demo.data.gouv.fr/api/1/ — for tests only; do not present demo results as production facts unless the user asked for demo.

Glossary

  • Dataset: A catalog entry (metadata, licence, frequency, tags) grouping resources.
  • Resource: A file or API link attached to a dataset (CSV, JSON, GeoJSON, etc.); each has an id used by Tabular when the file is tabular-compatible on the platform.
  • Organization / producer: Publisher entity; datasets may belong to an organization.
  • Reuse: A project or article that references platform datasets or dataservices.
  • Dataservice: A documented external HTTP API (OpenAPI/Swagger often at machine_documentation_url) with a base_api_url for calls. Same class of APIs that were once referenced on api.gouv.fr; the catalog entry on the open data platform is now a dataservice.
  • Slug: Human-readable id in URLs; may change; UUID is safer for scripts.

Producer coaching (documentation and publication quality)

When the user asks how to prepare, document, or legally qualify data for publication on data.gouv.fr without using write APIs here, ground answers in the official guides (fetch pages if the client allows, otherwise give links): Guide qualité, Guide juridique. This skill is not legal advice; encourage human review for obligations and licensing.


Intent routing (optional)

flowchart LR
  subgraph discovery [Discovery]
    A[CatalogMetadata]
    B[RowQueries]
    C[UsageStats]
    D[ExternalAPI]
  end
  A --> MainAPI[MainAPI]
  B --> TabularAPI[TabularAPI]
  C --> MetricsAPI[MetricsAPI]
  D --> Dataservices[DataservicesThenUpstream]

1. Main API

Base URL: https://www.data.gouv.fr/api/1/ | Demo: https://demo.data.gouv.fr/api/1/

Auth: Read public. Write (POST/PUT/PATCH/DELETE): header X-API-KEY. Permissions = web (org member to edit org datasets). private: true for drafts. IDs: technical id or slug; prefer technical id. Content: JSON; file uploads: multipart/form-data. Optional: X-Fields to limit returned fields.

Response: Paginated lists: data, page, page_size, total, next_page, previous_page. Errors: 400, 401, 403, 404, 410, 423, 500, 502. Body: {"message":"..."}. Rate limits: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

Datasets

MethodPath
GET/datasets/ — q, page, page_size, sort, organization, owner, tag, license, format, geozone, granularity, temporal_coverage, schema, topic, archived, deleted, private
POST/datasets/ — title, description, frequency, last_update, organization/owner, license, tags, private
GET/PUT/DELETE/datasets/{id}/
GET/datasets/{id}/resources/
POST/datasets/{id}/resources/ — create
PUT/datasets/{id}/resources/ — reorder (body: array)
GET/PUT/DELETE/datasets/{id}/resources/{rid}/
POST/datasets/{id}/resources/{rid}/upload/ or /datasets/{id}/upload/
POST/DELETE/datasets/{id}/badges/, /datasets/{id}/badges/{badge_kind}/
POST/DELETE/datasets/{id}/featured/
GET/POST/DELETE/datasets/{id}/followers/
GET/datasets/{id}/rdf, /datasets/{id}/rdf.{_format}
GET/POST/.../datasets/community_resources/, .../{community}/, .../upload/
GET/datasets/badges/, frequencies/, licenses/, resource_types/, extensions/, schemas/
GET/datasets/suggest/, suggest/formats/, suggest/mime/ — q, size
GET/datasets/r/{id}/ — redirect to latest resource
GET/datasets/recent.atom

Organizations

MethodPath
GET/POST/organizations/
GET/PUT/DELETE/organizations/{id}/
POST/PUT/DELETE/organizations/{id}/member/{user}/ — role: admin
GET/POST/organizations/{id}/membership/, .../accept/{id}/, .../refuse/{id}/
GET/organizations/{id}/datasets/, reuses/, discussions/, contacts/, contacts/suggest/
GET/organizations/{id}/datasets.csv, dataservices.csv, datasets-resources.csv, discussions.csv
GET/organizations/{id}/catalog, catalog.{_format}
GET/POST/DELETE/organizations/badges/, {id}/badges/, {id}/badges/{badge_kind}/
POST/PUT/organizations/{id}/logo/
GET/organizations/roles/, suggest/
GET/POST/DELETE/organizations/{id}/followers/

Users

MethodPath
GET/POST/users/
GET/PUT/DELETE/users/{id}/
POST/users/{id}/avatar/
GET/users/{id}/contacts/
GET/users/roles/, suggest/
GET/POST/DELETE/users/{id}/followers/

Me (authenticated)

MethodPath
GET/PUT/DELETE/me/
DELETE/POST/me/apikey/
POST/me/avatar/
GET/me/datasets/, reuses/, metrics/, org_datasets/, org_reuses/, org_community_resources/, org_discussions/

Reuses

MethodPath
GET/POST/reuses/ — q, organization, owner, tag, topic, type, dataset, featured
GET/PUT/DELETE/reuses/{id}/
POST/reuses/{id}/datasets/, dataservices/
GET/POST/DELETE/reuses/badges/, {id}/badges/, {id}/featured/
POST/reuses/{id}/image/
GET/reuses/topics/, types/, suggest/
GET/POST/DELETE/reuses/{id}/followers/
GET/reuses/recent.atom

Dataservices (external APIs)

External administrative or public HTTP APIs were historically listed on api.gouv.fr; they are now represented as dataservices on data.gouv.fr (GET /dataservices/, object fields below).

MethodPath
GET/POST/dataservices/ — GET: q, page, page_size, organization, owner, topic, tag, access_type, featured, dataset, sort
GET/PATCH/DELETE/dataservices/{id}/ — GET returns base_api_url, machine_documentation_url (OpenAPI/Swagger spec), title, description, organization, license, etc.
POST/dataservices/{id}/datasets/ — body: [{id}]
DELETE/dataservices/{id}/datasets/{dataset}/
POST/DELETE/dataservices/{id}/featured/
GET/dataservices/{id}/rdf, rdf.{_format}
GET/POST/DELETE/dataservices/{id}/followers/
GET/dataservices/recent.atom

Access and auth: Each object includes access_type (and related fields such as access_type_reason, authorization_request_url). Rules are per dataservice, not platform-wide: follow the web page (self_web_url), business_documentation_url, and the upstream OpenAPI for API keys, OAuth, DataPass, or other flows.

Rate limits: rate_limiting and rate_limiting_url describe producer quotas on the external API. The Main API’s **X-RateLimit-* headers apply only to catalog** requests (/dataservices/, etc.), not to calls you make to base_api_url.

Bulk export (metadata): GET /site/dataservices.csv returns a site-wide CSV of dataservice rows for spreadsheets or scripts (same catalog as the JSON list).

OpenAPI is authoritative: Always fetch machine_documentation_url before calling the live API. Paths, parameters, and schemas come from that spec; if human text on the portal or this skill disagrees with the fetched OpenAPI, trust the OpenAPI (same principle as Metrics and Tabular Swaggers in §References and freshness).

To use a dataservice: (1) Find it: MCP search_dataservices or GET /dataservices/?q=term (follow next_page until done). (2) GET /dataservices/{id}/ (or the MCP equivalent) for machine_documentation_url and base_api_url. (3) Fetch machine_documentation_url for the OpenAPI spec. (4) Call base_api_url per that spec.

Contacts, Harvest, Discussions, Notifications

MethodPath
POST/contacts/ — name, email, role
GET/contacts/roles/
GET/PUT/DELETE/contacts/{id}/
GET/POST/harvest/sources/
GET/PUT/DELETE/harvest/source/{id}/
GET/harvest/source/{id}/jobs/, /harvest/job/{ident}/
POST/harvest/source/{id}/run/
POST/DELETE/harvest/source/{id}/schedule/
GET/POST/harvest/source/{id}/preview/, /harvest/source/preview/
POST/harvest/source/{id}/validate/
GET/harvest/backends/
GET/POST/PUT/DELETE/discussions/, discussions/{id}/
POST/discussions/{id}/ — comment, close (body)
PUT/DELETE/discussions/{id}/comments/{idx}/
DELETE/discussions/{id}/comments/{idx}/spam/, discussions/{id}/spam/
GET/notifications/
POST/notifications/{id}/read/

Posts, Pages, Reports, Transfer, Activity, Site, Spatial, Tags

MethodPath
GET/POST/posts/ — name, content, body_type, kind, datasets, reuses
GET/PUT/DELETE/posts/{id}/
POST/PUT/posts/{id}/image/
POST/DELETE/posts/{id}/publish/
GET/posts/recent.atom
GET/POST/pages/
GET/PUT/pages/{id}/
GET/POST/reports/ — reason (explicit_content
GET/reports/reasons/
GET/PATCH/reports/{id}/
GET/POST/transfer/, transfer/{id}/ — subject, recipient, comment; response: accept\refuse
GET/activity/ — user, organization, related_to
GET/PATCH/site/
GET/site/catalog, catalog.{_format}, context.jsonld, data.{_format}
GET/site/datasets.csv, dataservices.csv, reuses.csv, organizations.csv, resources.csv, harvests.csv, tags.csv
GET/access_type/reason_categories/
GET/avatars/{identifier}/{size}/
GET/spatial/granularities/, levels/, coverage/{level}/, zone/{id}/, zone/{id}/datasets/, zones/{ids}/, zones/suggest/
GET/tags/suggest/
GET/spam/
GET/proconnect/auth, login/, logout, logout_oauth
GET/POST/workers/jobs/
GET/PUT/DELETE/workers/jobs/{id}/
GET/workers/jobs/schedulables/, workers/tasks/{id}/

2. Metrics API

Base URL: https://metric-api.data.gouv.fr | Swagger: https://metric-api.data.gouv.fr/api/doc

MethodPathDescription
GET/api/{model}/data/Paginated metrics rows (JSON). Params: page, page_size, column__sort, column__exact, column__contains, column__less, column__greater
GET/api/{model}/data/csv/Metrics export for {model} as CSV (same column filters as JSON where applicable; not the Tabular API resource CSV format)
GET/health/Health check

{model} = table name (e.g. site, organization, dataset). See Swagger for models and columns.


3. Tabular API

Base URL: https://tabular-api.data.gouv.fr | Swagger: https://tabular-api.data.gouv.fr/api/doc | Per-resource: GET /api/resources/{rid}/swagger/

{rid} = resource UUID from main API (dataset's resources).

Tabular data workflow (use in order):

  1. GET /api/resources/{rid}/ — confirm the resource is exposed and get links.
  2. GET /api/resources/{rid}/profile/ — column types, stats, indexes.
  3. GET /api/resources/{rid}/swagger/ — allowed query params and operators per column (read before complex filters).
  4. GET /api/resources/{rid}/data/ — page and page_size (max 50). For aggregations, check /api/aggregation-exceptions/ first (only listed resources/columns may support groupby/count/sum, etc.).
MethodPathDescription
GET/api/resources/{rid}/Metadata, links to profile/data/swagger
GET/api/resources/{rid}/profile/Column types, formats, stats, indexes
GET/api/resources/{rid}/swagger/OpenAPI for data endpoint (columns, operators)
GET/api/aggregation-exceptions/Resource UUIDs allowed for aggregation
GET/api/resources/{rid}/data/Filter, sort, paginate (page, page_size max 50)
GET/api/resources/{rid}/data/csv/Stream CSV
GET/api/resources/{rid}/data/json/Stream JSON
GET/health/Health check

Data params: columns=col1,col2 | Filter: column__exact, __differs, __isnull, __isnotnull, __contains, __notcontains, __in, __notin, __less, __greater, __strictly_less, __strictly_greater | Sort: column__sort=asc|desc | Aggregation (allowed resources, indexed cols): column__groupby, __count, __avg, __min, __max, __sum. JSON columns: only isnull/isnotnull.


Quick examples

import requests

BASE = "https://www.data.gouv.fr/api/1"

# 1) Search catalog, then open first hit
r = requests.get(f"{BASE}/datasets/", params={"q": "transport", "page_size": 5}).json()
first = r["data"][0]
ds = requests.get(f"{BASE}/datasets/{first['id']}/").json()

# 2) Pick a CSV resource UUID, then Tabular profile + data (use any resource id exposed by Tabular)
csvs = [res for res in ds["resources"] if res.get("format", "").lower() == "csv"]
rid = csvs[0]["id"] if csvs else ds["resources"][0]["id"]
requests.get(f"https://tabular-api.data.gouv.fr/api/resources/{rid}/profile/").json()
requests.get(
    f"https://tabular-api.data.gouv.fr/api/resources/{rid}/data/",
    params={"page": 1, "page_size": 20},
).json()

# 3) Direct file download (when you need the raw file, not row filtering)
url = next(res["url"] for res in ds["resources"] if res["id"] == rid)
requests.get(url, stream=True)
# Metrics API — paginated dataset metrics (models/columns in Swagger)
requests.get(
    "https://metric-api.data.gouv.fr/api/dataset/data/",
    params={"page": 1, "page_size": 20},
).json()

Python client: https://github.com/etalab/datagouv-client-python


References and freshness

For sharing with humans, dataset pages on www.data.gouv.fr use slugs from API fields; metadata and ids should still come from GET responses.

平台分布

Codex

37.06%
按下载量换算43

Claude

29.71%
按下载量换算34

Cursor

20.75%
按下载量换算24

Gemini CLI

9.2%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills