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.
openapi: 3.2.0
info:
title: Dinum Geopf API
version: '1.0'
description: 'Operations tagged geopf across 2 of this provider''s published API definitions: data-gouv-fr-api-v1-swagger.json, dinum-data-gouv-fr-v1-openapi.yml. Each path carries the servers of the definition it was published in.'
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
servers:
- url: https://www.data.gouv.fr/api/1
/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
servers:
- url: https://www.data.gouv.fr/api/1
/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
servers:
- url: https://www.data.gouv.fr/api/1
/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
servers:
- url: https://www.data.gouv.fr/api/1
/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
servers:
- url: https://www.data.gouv.fr/api/1
/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
servers:
- url: https://www.data.gouv.fr/api/1
/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
servers:
- url: https://www.data.gouv.fr/api/1
/geopf/token/:
delete:
operationId: geopf_disconnect
responses:
'204':
description: Disconnected
summary: Disconnect the current user from Géoplateforme
tags:
- geopf
servers:
- url: https://www.data.gouv.fr/api/1
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
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
GeopfTask:
properties:
task_id:
description: The id of the enqueued Celery task
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
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
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
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
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
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
securitySchemes:
apikey:
in: header
name: X-API-KEY
type: apiKey
x-refined-from:
- data-gouv-fr-api-v1-swagger.json
- dinum-data-gouv-fr-v1-openapi.yml