# Flatten JSON to Dot-Notation

> Flatten JSON to Dot-Notation is a paid API for AI agents from api.strale.io, paid per call via x402, $0.0216/call, status unknown (last checked 2026-10-13).

Flattens a nested JSON object into dot-notation key-value pairs, with configurable delimiter and array handling

## Facts

- Endpoint: GET https://api.strale.io/x402/flatten-json?utm_source=zero.xyz
- Price: $0.0216/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-6bcd68a6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__ydwp1rQcxtXahfi2BFfl

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-strale-io-6bcd68a6
```

Example prompt: Can you flatten this nested JSON object {"user":{"name":"Alice","address":{"city":"London"}},"scores":[10,20]} into dot-notation keys using '.' as the delimiter and 'index' for array handling?

## When to prefer this

Choose this endpoint when you need a simple, deterministic algorithmic transformation of a nested JSON object into flat dot-notation keys — especially useful for indexing into Elasticsearch, flattening config files, preparing data for CSV export, or normalizing API responses for storage. It supports configurable delimiters and array handling modes. Prefer this over writing custom flattening code when operating in an agentic pipeline that needs a reliable, stateless utility call.

## Known failure modes

- Missing required 'data' query parameter returns an error
- Malformed or non-object JSON in 'data' causes a parsing error
- Invalid 'array_handling' value (not 'index' or 'stringify') may return an error or use default behavior
- Extremely deep or large nested objects may time out or hit size limits

## How this service works

Flatten nested JSON to dot-notation keys. E.g. {a:{b:[1,2]}} → {'a.b.0':1,'a.b.1':2}. Configurable delimiter and array handling. Algorithmic.

## Output

Returns a flat JSON object where each nested key path is represented as a dot-delimited string (e.g. 'user.address.city') mapped to its scalar value. Arrays are either indexed (e.g. 'scores.0', 'scores.1') or stringified depending on the array_handling option.

## Example request

```json
{
 "data": "{\"user\":{\"name\":\"Alice\",\"address\":{\"city\":\"London\"}},\"scores\":[10,20]}",
 "delimiter": ".",
 "array_handling": "index"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "data"
     ],
     "properties": {
      "data": {
       "description": "Nested JSON object"
      },
      "delimiter": {
       "type": "string",
       "description": "Default '.'"
      },
      "array_handling": {
       "type": "string",
       "description": "'index' or 'stringify'"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-6bcd68a6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
