{
  "x402Version": 2,
  "id": 6765,
  "slug": "6765",
  "resource": "https://api.geoprimitives.dev/v1/geojson/repair",
  "description": "Repair GeoJSON and get the fixed document back with a log of every alteration: rings rewound to RFC 7946 winding order, consecutive duplicate vertices dropped, unclosed rings closed, and polygon nesting fixed (mis-ordered exterior rings, holes that fall outside their exterior, MultiPolygon members that are really holes). Reach for it when POST /v1/geojson/validate reported errors, or when /v1/geometry, /v1/h3/polyfill or /v1/pip refused your document -- unclosed rings are the usual reason, and this is the cheapest way to clear them. Conservative by design: it only rewrites the classes above, and anything else it found is returned in unrepaired rather than guessed at, so it will not invent geometry or move a coordinate. Idempotent -- a conformant document comes back untouched with changed:false, so a second call costs money and changes nothing. Your input object is never mutated. Coordinate values are preserved exactly; nothing is rounded or reprojected. Limit: 1 MiB request body.",
  "type": "http",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0x76A51b5Dd3729950B3b60c17f19252d221968FCe",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "10000",
      "maxTimeoutSeconds": 300
    }
  ],
  "outputSchema": {
    "bazaar": {
      "info": {
        "input": {
          "body": {
            "coordinates": [
              [
                [
                  0,
                  0
                ],
                [
                  0,
                  1
                ],
                [
                  0,
                  1
                ],
                [
                  1,
                  1
                ],
                [
                  1,
                  0
                ],
                [
                  0,
                  0
                ]
              ]
            ],
            "type": "Polygon"
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "changeCount": 2,
            "changed": true,
            "changes": [
              {
                "code": "deduped_vertices",
                "message": "Removed 1 consecutive duplicate position.",
                "path": "$.coordinates[0]",
                "ringIndex": 0
              },
              {
                "code": "rewound_ring",
                "message": "Reversed exterior ring to counterclockwise.",
                "path": "$.coordinates[0]",
                "ringIndex": 0
              }
            ],
            "geojson": {
              "coordinates": [
                [
                  [
                    0,
                    0
                  ],
                  [
                    1,
                    0
                  ],
                  [
                    1,
                    1
                  ],
                  [
                    0,
                    1
                  ],
                  [
                    0,
                    0
                  ]
                ]
              ],
              "type": "Polygon"
            },
            "unrepaired": []
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "additionalProperties": true,
                "properties": {
                  "coordinates": {
                    "description": "Present on a bare Geometry other than GeometryCollection.",
                    "type": "array"
                  },
                  "features": {
                    "description": "Present when type is FeatureCollection.",
                    "items": {
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "geometries": {
                    "description": "Present when type is GeometryCollection.",
                    "items": {
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "geometry": {
                    "description": "Present when type is Feature. May be null.",
                    "type": "object"
                  },
                  "type": {
                    "description": "GeoJSON type. Post the document itself: a Feature, a FeatureCollection, or a bare Geometry.",
                    "enum": [
                      "FeatureCollection",
                      "Feature",
                      "Point",
                      "MultiPoint",
                      "LineString",
                      "MultiLineString",
                      "Polygon",
                      "MultiPolygon",
                      "GeometryCollection"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "type"
                ],
                "type": "object"
              },
              "bodyType": {
                "enum": [
                  "json",
                  "form-data",
                  "text"
                ],
                "type": "string"
              },
              "method": {
                "enum": [
                  "POST"
                ],
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method",
              "bodyType",
              "body"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "bazaar"
  ],
  "sourceHost": "api.geoprimitives.dev",
  "lastUpdated": "2026-08-21T17:25:52.02Z",
  "quality": {
    "calls30d": 1,
    "uniquePayers30d": 1,
    "lastCalledAt": "2026-08-21T17:25:51.887Z"
  },
  "liveness": {},
  "verified": false,
  "featured": false,
  "provider": {
    "host": "api.geoprimitives.dev",
    "manifest_name": "api.geoprimitives.dev",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-09-18T22:00:31.484Z"
  }
}