{
  "openapi": "3.0.1",
  "info": {
    "title": "uData Portal Extractor (data.gouv.fr & Etalab)",
    "description": "Point at ANY uData open-data portal (data.gouv.fr, data.public.lu, ~30 Etalab govs) and extract datasets, organizations, or community reuses via the uniform /api/1/ REST API. Nested resources, facet filters (q/tag/org/license), server-driven pagination.",
    "version": "0.1",
    "x-build-id": "vhwOXvgiZKA6ilQkn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~udata-portal-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-udata-portal-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/datamule~udata-portal-extractor/runs": {
      "post": {
        "operationId": "runs-sync-datamule-udata-portal-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/datamule~udata-portal-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-udata-portal-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "portalUrl"
        ],
        "properties": {
          "portalUrl": {
            "title": "uData portal URL",
            "type": "string",
            "description": "Base URL of ANY uData open-data portal (the Etalab platform behind data.gouv.fr and ~30 francophone/EU government portals). The '/api/1/…' path is appended automatically. Examples: https://www.data.gouv.fr (73k+ datasets) · https://data.public.lu (Luxembourg). Note: transport.data.gouv.fr uses a different specialised API shape and is out of scope — this actor targets the standard '/api/1/' uData core."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "datasets",
              "organizations",
              "reuses"
            ],
            "type": "string",
            "description": "What to extract. 'datasets' (default) → one row per dataset with its resources[] summarised on (resourceCount + first resource url/format/filesize/mime) and the full lossless resources array kept. 'organizations' → one row per publishing organisation. 'reuses' → one row per community reuse (apps/articles/visualisations built on the portal's data — a uData-unique layer).",
            "default": "datasets"
          },
          "query": {
            "title": "Search query (q=)",
            "type": "string",
            "description": "Optional full-text filter — the uData 'q=' parameter. Applies to whichever mode is selected. e.g. 'transport', 'budget', 'covid'."
          },
          "tag": {
            "title": "Tag filter",
            "type": "string",
            "description": "Optional tag facet (datasets/reuses). Only records carrying this tag are returned, e.g. 'transport', 'mobilite-durable'."
          },
          "organization": {
            "title": "Organization id filter",
            "type": "string",
            "description": "Optional organization id (the uData org id, e.g. '534fff8ba3a7292c64a77de4') to return only datasets/reuses published by that organization. Use 'organizations' mode first to discover ids."
          },
          "license": {
            "title": "License filter",
            "type": "string",
            "description": "Optional license id facet for datasets, e.g. 'lov2' (Licence Ouverte 2.0), 'cc-by', 'odc-odbl'."
          },
          "emitResources": {
            "title": "Also emit one row per resource (datasets mode)",
            "type": "boolean",
            "description": "In 'datasets' mode, additionally emit ONE extra row per resource (each an actual downloadable file: url/format/filesize/checksum/mime) joined to its parent dataset. Each resource row is billed as a record. Off by default — the dataset row already carries a resource summary + the full lossless resources array.",
            "default": false
          },
          "maxRecords": {
            "title": "Max records",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after emitting this many records (dataset/organization/reuse rows, plus resource rows when emitResources is on). Pagination halts early once reached.",
            "default": 2000
          },
          "pageSize": {
            "title": "Page size",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Records requested per API page (uData 'page_size'). The server caps this; values above 500 are clamped to 500.",
            "default": 50
          },
          "userAgent": {
            "title": "User-Agent (optional)",
            "type": "string",
            "description": "Override the default descriptive User-Agent header. These are government servers — please keep a descriptive agent."
          },
          "timeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "type": "integer",
            "description": "Per-request timeout in seconds for each API page fetch.",
            "default": 60
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}