api.gouv.fr Geopf API

Géoplateforme related operations

GitHub OpenAPI

Operations 8

GET /geopf/auth OAuth callback: exchange the code, persist the token, bounce back to cdata #
GET /geopf/datastores/ List the entrepôts (datastores) available to the current user's geopf account #
GET /geopf/login/ Start the OAuth link between the current user and their geopf identity #
POST /geopf/pull-offerings/{dataset}/ Pull Géoplateforme offerings into resources for this dataset, as the current… #
POST /geopf/push/{dataset}/{rid}/ Push a resource to Géoplateforme, as the current user #
GET /geopf/status/ Whether the current user has an active, usable geopf link #
GET /geopf/status/{dataset}/ A dataset's Géoplateforme sync state, as stored locally #
DELETE /geopf/token/ Disconnect the current user from Géoplateforme #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-gouv-fr:api-gouv-fr-geopf-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-gouv-fr-geopf-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: uData API
  title: uData Geopf API
  version: '1.0'
servers:
- url: https://www.data.gouv.fr/api/1
tags:
- description: Géoplateforme related operations
  name: geopf
paths:
  /geopf/auth:
    get:
      operationId: geopf_auth
      responses:
        '200':
          description: Success
      summary: 'OAuth callback: exchange the code, persist the token, bounce back to cdata'
      tags:
      - geopf
  /geopf/datastores/:
    get:
      operationId: geopf_datastores
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/GeopfDatastore'
                type: array
        '424':
          description: Not connected to Géoplateforme
        '502':
          description: Géoplateforme API error
      summary: List the entrepôts (datastores) available to the current user's geopf account
      tags:
      - geopf
  /geopf/login/:
    get:
      operationId: geopf_login
      responses:
        '200':
          description: Success
      summary: Start the OAuth link between the current user and their geopf identity
      tags:
      - geopf
  /geopf/pull-offerings/{dataset}/:
    parameters:
    - description: The dataset ID or slug
      in: path
      name: dataset
      required: true
      schema:
        type: string
    post:
      operationId: geopf_pull_offerings
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '202':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeopfTask'
        '424':
          description: Not connected to Géoplateforme
      summary: Pull Géoplateforme offerings into resources for this dataset, as the current…
      tags:
      - geopf
  /geopf/push/{dataset}/{rid}/:
    parameters:
    - description: The dataset ID or slug
      in: path
      name: dataset
      required: true
      schema:
        type: string
    - description: The resource ID
      in: path
      name: rid
      required: true
      schema:
        type: string
    post:
      operationId: geopf_push
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '202':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeopfTask'
        '400':
          description: Private dataset, unsupported resource format or missing datastore_id
        '404':
          description: Resource not found
        '409':
          description: A push is in progress or the resource was already pushed
        '424':
          description: Not connected to Géoplateforme
      summary: Push a resource to Géoplateforme, as the current user
      tags:
      - geopf
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GeopfPushRequest'
        required: true
  /geopf/status/:
    get:
      description: 'A stored token whose access token is merely expired still counts as

        connected (it gets refreshed here as a side effect); only a token

        that can no longer be refreshed reports as disconnected.'
      operationId: geopf_status
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeopfStatus'
      summary: Whether the current user has an active, usable geopf link
      tags:
      - geopf
  /geopf/status/{dataset}/:
    parameters:
    - description: The dataset ID or slug
      in: path
      name: dataset
      required: true
      schema:
        type: string
    get:
      description: 'A pure read of the dataset''s and its resources'' `geopf` metadata: no

        call to the geopf API and no token refresh, so it answers the same

        whether or not the current user is connected.


        Resources are split into those eligible for a push (format in

        `GEOPF_PUSHABLE_FORMATS`) and those that came back from a pull as

        offerings; the two are disjoint.


        A `status` of `null` means "never run"; otherwise it is one of

        `pending`, `done`, `error` or `timeout`.'
      operationId: geopf_dataset_status
      parameters:
      - description: An optional fields mask
        in: header
        name: X-Fields
        schema:
          type: string
          format: mask
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeopfDatasetStatus'
      summary: A dataset's Géoplateforme sync state, as stored locally
      tags:
      - geopf
  /geopf/token/:
    delete:
      operationId: geopf_disconnect
      responses:
        '204':
          description: Disconnected
      summary: Disconnect the current user from Géoplateforme
      tags:
      - geopf
components:
  schemas:
    GeopfPushableResource:
      properties:
        format:
          description: The resource format
          type: string
        id:
          description: The resource id
          type: string
        push:
          $ref: '#/components/schemas/GeopfResourcePushMetadata__read'
        title:
          description: The resource title
          type: string
        url:
          description: The resource url
          type: string
      type: object
    GeopfTask:
      properties:
        task_id:
          description: The id of the enqueued Celery task
          type: string
      type: object
    GeopfPushRequest:
      properties:
        datastore_id:
          description: The datastore to push to. Optional if the dataset already has one configured from a previous push.
          type: string
      type: object
    GeopfDatasetStatus:
      properties:
        offerings:
          description: Resources that came back from a pull as geopf offerings
          items:
            $ref: '#/components/schemas/GeopfOfferingResource'
          type: array
        pull:
          $ref: '#/components/schemas/GeopfDatasetPullMetadata__read'
        push:
          $ref: '#/components/schemas/GeopfDatasetPushMetadata__read'
        pushable:
          description: Resources eligible for a push
          items:
            $ref: '#/components/schemas/GeopfPushableResource'
          type: array
      type: object
    GeopfDatasetPushMetadata__read:
      properties:
        datasheet_url:
          description: The cartes.gouv.fr fiche de données url for this dataset
          readOnly: true
          type: string
        datastore_id:
          description: The geopf datastore configured for this dataset's pushes
          readOnly: true
          type: string
      type: object
    GeopfResourcePushMetadata__read:
      properties:
        error:
          description: The last push error, if any
          readOnly: true
          type: string
        last_synced_at:
          description: Last successful push date
          format: date-time
          readOnly: true
          type: string
        status:
          description: 'Push status: null (never run), pending, done, error or timeout'
          enum:
          - pending
          - done
          - error
          - timeout
          example: pending
          readOnly: true
          type: string
        stored_data_id:
          description: The geopf stored_data id produced by the last push
          readOnly: true
          type: string
        task_id:
          description: The last push Celery task's id
          readOnly: true
          type: string
      type: object
    GeopfDatasetPullMetadata__read:
      properties:
        error:
          description: The last pull error, if any
          readOnly: true
          type: string
        last_synced_at:
          description: Last successful pull date
          format: date-time
          readOnly: true
          type: string
        status:
          description: 'Pull status: null (never run), pending, done or error'
          enum:
          - pending
          - done
          - error
          example: pending
          readOnly: true
          type: string
        task_id:
          description: The last pull Celery task's id
          readOnly: true
          type: string
      type: object
    GeopfDatastore:
      properties:
        datastore_id:
          description: The datastore id
          type: string
        name:
          description: The datastore display name
          type: string
        rights:
          description: The current user's rights on this datastore
          items:
            type: string
          type: array
      type: object
    GeopfOfferingResource:
      properties:
        format:
          description: The resource format
          type: string
        id:
          description: The resource id
          type: string
        offering:
          $ref: '#/components/schemas/GeopfResourceOfferingMetadata__read'
        title:
          description: The resource title
          type: string
        url:
          description: The resource url
          type: string
      type: object
    GeopfStatus:
      properties:
        connected:
          description: Whether the current user has an active, usable geopf link
          type: boolean
        expires_at:
          description: The stored geopf token's expiration date
          format: date-time
          type: string
      type: object
    GeopfResourceOfferingMetadata__read:
      properties:
        id:
          description: The geopf offering id
          readOnly: true
          type: string
        last_synced_at:
          description: Last successful pull date for this offering
          format: date-time
          readOnly: true
          type: string
      type: object
  securitySchemes:
    apikey:
      in: header
      name: X-API-KEY
      type: apiKey