# getInseeData

**Identifier:** `insee_getInseeData`

**Provider:** [INSEE Statistics](https://kirha.com/providers/insee.md)

Read observations of an INSEE dataset for a place, filtered on dimension codes found with describeInseeDataset.

## Run it with the CLI

```bash
kirha tools run insee_getInseeData \
  --input '{
    "datasetId": "<datasetId>"
  }'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "insee_getInseeData",
  "input": {
    "datasetId": "<datasetId>"
  }
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "datasetId": {
      "minLength": 3,
      "type": "string"
    },
    "filters": {
      "additionalProperties": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "description": "Dimension codes to keep, e.g., {\"SEX\": [\"_T\"], \"TIME_PERIOD\": [\"2023\"]}",
      "propertyNames": {
        "type": "string"
      },
      "type": "object"
    },
    "limit": {
      "description": "Defaults to 50",
      "maximum": 200,
      "minimum": 1,
      "type": "integer"
    },
    "place": {
      "description": "Commune, EPCI, department, region or France, by name or code",
      "minLength": 2,
      "type": "string"
    }
  },
  "required": [
    "datasetId"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "string"
    },
    "datasetId": {
      "type": "string"
    },
    "place": {
      "type": "string"
    },
    "rows": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "total": {
      "type": "number"
    }
  },
  "required": [
    "context",
    "datasetId",
    "total",
    "rows"
  ],
  "type": "object"
}
```

## Related tools

Other INSEE Statistics tools that this tool refers to, or that refer to it.

- [`searchInseeDatasets`](https://kirha.com/providers/insee/searchInseeDatasets.md)
- [`describeInseeDataset`](https://kirha.com/providers/insee/describeInseeDataset.md)

-----

[All INSEE Statistics tools](https://kirha.com/providers/insee.md) · [< Back to tools list](https://kirha.com/tools.md)