{
  "openapi": "3.0.3",
  "info": {
    "title": "CheckMyStreet Partner API",
    "version": "1.0",
    "description": "Valuations and street analysis for homes in England and Wales.\n\nEvery call needs a bearer token from the token URL (OAuth 2.0 client credentials, 30 minute\ntokens). Errors are RFC 9457 problem details. Test credentials return fake, deterministic data,\ncarry `\"mode\": \"test\"` and are never charged.\n",
    "termsOfService": "https://developers.checkmystreet.co.uk/terms"
  },
  "servers": [
    {
      "url": "https://api.checkmystreet.co.uk/partners/v1"
    }
  ],
  "tags": [
    {
      "name": "Valuation",
      "description": "A low, middle and high figure for a home, and the share of past sales at that price level\nthat landed inside the range.\n"
    },
    {
      "name": "Street analysis",
      "description": "What surrounds a postcode, grouped: sold prices, crime, transport, rents, energy use and\nthe local house price index. Never a coordinate.\n"
    }
  ],
  "security": [
    {
      "oauth2": []
    }
  ],
  "paths": {
    "/valuations": {
      "post": {
        "tags": [
          "Valuation"
        ],
        "operationId": "createValuation",
        "summary": "Create a valuation",
        "description": "Values one home. Send a new `Idempotency-Key` for each valuation you want, and reuse it\nonly to retry that same request: however many times you retry with one key, you are\ncharged once.\n\nAdd `include` to have the written commentary and the rebuild cost added to the valuation.\nBoth are free: the call costs the same with or without them.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValuationRequest"
              },
              "examples": {
                "smallest": {
                  "summary": "The smallest valid request",
                  "value": {
                    "postcode": "M1 1AE",
                    "propertyType": "flat",
                    "bedrooms": 2
                  }
                },
                "full": {
                  "summary": "With a floor area and your own case number",
                  "value": {
                    "postcode": "M1 1AE",
                    "propertyType": "flat",
                    "floorAreaSqm": 57,
                    "yearBuilt": 2004,
                    "builtForm": "mid_terrace",
                    "wallsEnergyEfficiency": "good",
                    "reference": "case-10492"
                  }
                },
                "withExtras": {
                  "summary": "With the commentary and the rebuild cost, both free",
                  "value": {
                    "postcode": "M1 1AE",
                    "propertyType": "semi_detached",
                    "bedrooms": 3,
                    "include": [
                      "commentary",
                      "rebuildCost"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The valuation. Figures are in pounds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Valuation"
                },
                "examples": {
                  "valuation": {
                    "summary": "A valuation",
                    "value": {
                      "id": "val_01j9xk2q7m4t8v6r3c5b0n1a2d",
                      "reference": "case-10492",
                      "valuedAt": "2026-11-03T10:15:02Z",
                      "valuation": {
                        "estimate": 425000,
                        "range": {
                          "low": 381000,
                          "high": 472000,
                          "coverage": 0.81
                        },
                        "currency": "GBP",
                        "indexedTo": "2026-08"
                      },
                      "location": {
                        "sector": "M1 1",
                        "localAuthority": "E08000003"
                      },
                      "dataQuality": "full",
                      "model": {
                        "version": "2026-09-28T15:05:18Z"
                      },
                      "input": {
                        "postcode": "M1 1AE",
                        "propertyType": "flat",
                        "floorAreaSqm": 57,
                        "floorAreaSource": "request",
                        "yearBuilt": 2004,
                        "builtForm": "mid_terrace",
                        "wallsEnergyEfficiency": "good"
                      },
                      "charge": {
                        "credits": 10,
                        "balanceAfter": 2490
                      }
                    }
                  },
                  "withExtras": {
                    "summary": "With the commentary and the rebuild cost",
                    "value": {
                      "id": "val_01j9xk2q7m4t8v6r3c5b0n1a2e",
                      "valuedAt": "2026-11-03T10:16:40Z",
                      "valuation": {
                        "estimate": 425000,
                        "range": {
                          "low": 381000,
                          "high": 472000,
                          "coverage": 0.81
                        },
                        "currency": "GBP",
                        "indexedTo": "2026-08"
                      },
                      "location": {
                        "sector": "M1 1",
                        "localAuthority": "E08000003"
                      },
                      "dataQuality": "full",
                      "model": {
                        "version": "2026-09-28T15:05:18Z"
                      },
                      "input": {
                        "postcode": "M1 1AE",
                        "propertyType": "semi_detached",
                        "bedrooms": 3,
                        "floorAreaSqm": 85,
                        "floorAreaSource": "bedrooms"
                      },
                      "commentary": {
                        "summary": "Based on the characteristics provided and current market data, the estimated market value of this semi-detached property (85 m²) in the M1 1 postcode sector is £425,000. The model's range for it runs from £381,000 to £472,000, which reflects how uncertain the estimate is. In back-testing, the sale price fell within the model's range for 81% of homes it valued at a similar level.",
                        "rangeWidth": "moderate",
                        "rangeNote": "The estimate range is moderate: the model is reasonably, but not closely, sure of the value of a home like this in this area. The range is calibrated using split-conformal prediction to an 80% target. In back-testing against homes this model valued at a similar level, 81% of sale prices fell within the range the model gave them.",
                        "property": "This is a semi-detached property. At 85 m², the floor area is broadly in line with the sector median of 82 m².",
                        "location": "The property is located in an average affluence band (IMD percentile: 48). The area has good transport connectivity (9 stations within 2 km).",
                        "marketMomentum": "steady",
                        "marketConditions": "The local authority district is currently showing mild positive momentum at 1.1% over three months. Market activity is above average in this local authority.",
                        "energyEfficiency": "Relatively few (2.1%) properties in this sector hold low EPC ratings, with an aggregate sector EPC score of 64.0.",
                        "dataQuality": "All model inputs were populated from the supplied property data and sector context, providing the most complete basis for the estimate.",
                        "marketSignals": "The live market signals for this area show no marked lean either way. These signals are given for context only: the estimate and its range are figures at the valuation date and have not been adjusted for them.",
                        "areaInsights": {
                          "growth": "This area has delivered a compound annual growth rate (CAGR) of 4.1% (1.2% in real terms after inflation adjustment). Volatility is relatively low at 6.3%, suggesting stable price progression.",
                          "overview": "A busy market with steady growth."
                        },
                        "disclaimer": "This estimate is produced by an automated statistical model and does not constitute a formal valuation, a property appraisal, or investment advice. It is not based on a physical inspection of the property. Seek independent professional advice before making any property transaction or investment decision."
                      },
                      "rebuildCost": {
                        "estimated": true,
                        "low": 196000,
                        "typical": 231000,
                        "high": 277000,
                        "pricesAsOf": "2026-06"
                      },
                      "charge": {
                        "credits": 10,
                        "balanceAfter": 2480
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorised"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/RequestInProgress"
          },
          "422": {
            "$ref": "#/components/responses/CannotBeValued"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/DataUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/Timeout"
          }
        }
      }
    },
    "/valuations/{id}": {
      "get": {
        "tags": [
          "Valuation"
        ],
        "operationId": "getValuation",
        "summary": "Read a valuation back",
        "description": "Returns a valuation you created. Free, and it never changes.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The `id` returned by `POST /valuations`.",
            "schema": {
              "type": "string",
              "pattern": "^val_[0-9a-z]{26}$",
              "example": "val_01j9xk2q7m4t8v6r3c5b0n1a2d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The valuation, as it was returned when it was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Valuation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorised"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/street-analysis/{postcode}": {
      "get": {
        "tags": [
          "Street analysis"
        ],
        "operationId": "getStreetAnalysis",
        "summary": "Read a postcode's street analysis",
        "description": "The postcode's sold prices, crime, transport, rents, energy use and local house price\nindex. The first read of a postcode is charged. Reading the same postcode again within\n30 days returns the same answer and is free; after 30 days it is read afresh and charged.\n",
        "parameters": [
          {
            "name": "postcode",
            "in": "path",
            "required": true,
            "description": "A full postcode in England or Wales, with or without the space (encoded as %20).",
            "schema": {
              "type": "string",
              "example": "M11AE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The analysis. Prices are in pounds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreetAnalysis"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorised"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not-found`: we hold nothing for that postcode.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/DataUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/Timeout"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "description": "Client credentials. Cache the token for its 30 minute lifetime.",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://auth.checkmystreet.co.uk/oauth2/token",
            "scopes": {
              "partners:read": "Live calls, charged to your balance",
              "partners:test": "Test mode, fake data, never charged"
            }
          }
        }
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "A unique value for this valuation, such as a UUID. A retry with the same key returns the\nfirst result and is never charged twice.\n",
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 128,
          "example": "5f2b8c1e-4a7d-4e0b-9c61-2d8f3a90b7e4"
        }
      }
    },
    "schemas": {
      "PropertyType": {
        "type": "string",
        "enum": [
          "detached",
          "semi_detached",
          "terraced",
          "flat"
        ]
      },
      "ValuationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "postcode",
          "propertyType"
        ],
        "description": "Send `bedrooms` or `floorAreaSqm`. One of them is required.",
        "properties": {
          "postcode": {
            "type": "string",
            "description": "A full postcode in England or Wales, with or without the space.",
            "example": "M1 1AE"
          },
          "propertyType": {
            "$ref": "#/components/schemas/PropertyType"
          },
          "bedrooms": {
            "type": "integer",
            "minimum": 0,
            "maximum": 20,
            "description": "Used to estimate the floor area when `floorAreaSqm` is not sent.",
            "example": 2
          },
          "floorAreaSqm": {
            "type": "number",
            "minimum": 10,
            "maximum": 2000,
            "description": "Floor area in square metres. Takes the place of `bedrooms`.",
            "example": 57
          },
          "yearBuilt": {
            "type": "integer",
            "minimum": 1500,
            "maximum": 2100,
            "description": "The year the property was built.",
            "example": 2004
          },
          "builtForm": {
            "type": "string",
            "enum": [
              "detached",
              "semi_detached",
              "mid_terrace",
              "end_terrace",
              "enclosed_mid_terrace",
              "enclosed_end_terrace"
            ],
            "description": "How the property is attached to its neighbours, as on its Energy Performance Certificate."
          },
          "wallsEnergyEfficiency": {
            "type": "string",
            "enum": [
              "very_good",
              "good",
              "average",
              "poor",
              "very_poor"
            ],
            "description": "The wall energy efficiency rating on the property's Energy Performance Certificate."
          },
          "reference": {
            "type": "string",
            "maxLength": 64,
            "description": "Your own case number, echoed back. Not a name or an address.",
            "example": "case-10492"
          },
          "include": {
            "type": "array",
            "description": "Extras to add to the valuation, both free: `commentary`, the written commentary, and\n`rebuildCost`, an indicative rebuild cost for buildings insurance. The order does not\nmatter and naming one twice is the same as naming it once. The commentary reads the\narea's market data, so the call takes a little longer. Anything else is refused as\n`invalid_value`.\n",
            "items": {
              "type": "string",
              "enum": [
                "commentary",
                "rebuildCost"
              ]
            },
            "example": [
              "commentary",
              "rebuildCost"
            ]
          }
        }
      },
      "Valuation": {
        "type": "object",
        "required": [
          "id",
          "valuedAt",
          "valuation",
          "location",
          "dataQuality",
          "model",
          "input"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Store this with your case. Reading the valuation back with it is free.",
            "example": "val_01j9xk2q7m4t8v6r3c5b0n1a2d"
          },
          "mode": {
            "type": "string",
            "enum": [
              "test"
            ],
            "description": "Present only in test mode. Never show a test result to a customer."
          },
          "reference": {
            "type": "string",
            "description": "The `reference` you sent, if any.",
            "example": "case-10492"
          },
          "valuedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-11-03T10:15:02Z"
          },
          "valuation": {
            "type": "object",
            "required": [
              "estimate",
              "range",
              "currency"
            ],
            "properties": {
              "estimate": {
                "type": "integer",
                "description": "The middle figure, in pounds.",
                "example": 425000
              },
              "range": {
                "type": "object",
                "required": [
                  "low",
                  "high",
                  "coverage"
                ],
                "properties": {
                  "low": {
                    "type": "integer",
                    "example": 381000
                  },
                  "high": {
                    "type": "integer",
                    "example": 472000
                  },
                  "coverage": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1,
                    "description": "The share of past sales at this price level that landed inside a range like\nthis one, in back-tests. It describes the model across many sales, not the odds\nfor this one property.\n",
                    "example": 0.81
                  }
                }
              },
              "currency": {
                "type": "string",
                "enum": [
                  "GBP"
                ]
              },
              "indexedTo": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}$",
                "description": "The month the valuation's price level stands at: the latest month the UK House\nPrice Index had published for the local authority when the property was valued,\nusually about two months before `valuedAt`. The model's price level is fixed when\nit is trained, so the figures are moved by that index's change since then. This is\nthe published past, not a forecast. Absent when it is not known.\n",
                "example": "2026-08"
              }
            }
          },
          "location": {
            "type": "object",
            "required": [
              "sector",
              "localAuthority"
            ],
            "properties": {
              "sector": {
                "type": "string",
                "description": "The postcode sector.",
                "example": "M1 1"
              },
              "localAuthority": {
                "type": "string",
                "description": "The ONS local authority code.",
                "example": "E08000003"
              }
            }
          },
          "dataQuality": {
            "type": "string",
            "enum": [
              "full",
              "partial"
            ],
            "description": "`full` when every property detail the model uses was sent or known. `partial` when\nsome were filled from typical values for the area.\n"
          },
          "model": {
            "type": "object",
            "required": [
              "version"
            ],
            "properties": {
              "version": {
                "type": "string",
                "format": "date-time",
                "description": "The model build that produced the figures.",
                "example": "2026-09-28T15:05:18Z"
              }
            }
          },
          "input": {
            "type": "object",
            "description": "What was valued, including anything we derived.",
            "required": [
              "postcode",
              "propertyType",
              "floorAreaSqm",
              "floorAreaSource"
            ],
            "properties": {
              "postcode": {
                "type": "string",
                "example": "M1 1AE"
              },
              "propertyType": {
                "$ref": "#/components/schemas/PropertyType"
              },
              "bedrooms": {
                "type": "integer",
                "example": 2
              },
              "floorAreaSqm": {
                "type": "number",
                "example": 57
              },
              "floorAreaSource": {
                "type": "string",
                "enum": [
                  "request",
                  "bedrooms"
                ],
                "description": "Whether the floor area was sent, or estimated from the bedrooms."
              },
              "yearBuilt": {
                "type": "integer"
              },
              "builtForm": {
                "type": "string"
              },
              "wallsEnergyEfficiency": {
                "type": "string"
              }
            }
          },
          "commentary": {
            "$ref": "#/components/schemas/Commentary"
          },
          "rebuildCost": {
            "$ref": "#/components/schemas/RebuildCost"
          },
          "charge": {
            "type": "object",
            "description": "Credits this call used, and your balance afterwards. Absent in test mode and on reads.",
            "required": [
              "credits",
              "balanceAfter"
            ],
            "properties": {
              "credits": {
                "type": "integer",
                "example": 10
              },
              "balanceAfter": {
                "type": "integer",
                "example": 2490
              }
            }
          }
        }
      },
      "Commentary": {
        "type": "object",
        "description": "Written commentary on the valuation, present only when `include` asked for it, and free.\nIt is written from fixed templates, not by AI, and quotes the valuation's own figures and\nthe area's published statistics. Show the `disclaimer` with it.\n",
        "required": [
          "summary",
          "rangeWidth",
          "rangeNote",
          "property",
          "location",
          "marketMomentum",
          "marketConditions",
          "energyEfficiency",
          "dataQuality",
          "disclaimer"
        ],
        "properties": {
          "summary": {
            "type": "string",
            "description": "The estimate and its range, in plain English."
          },
          "rangeWidth": {
            "type": "string",
            "enum": [
              "narrow",
              "moderate",
              "wide"
            ],
            "description": "How wide the range is against the estimate."
          },
          "rangeNote": {
            "type": "string",
            "description": "What the range's width means, and how often ranges like it held in back-tests."
          },
          "property": {
            "type": "string",
            "description": "The home against others in its postcode sector."
          },
          "location": {
            "type": "string",
            "description": "Deprivation, transport access and crime around the postcode."
          },
          "marketMomentum": {
            "type": "string",
            "enum": [
              "accelerating",
              "steady",
              "cooling",
              "declining",
              "unknown"
            ],
            "description": "Price momentum in the local authority. `unknown` when there is too little data."
          },
          "marketConditions": {
            "type": "string",
            "description": "Momentum, volatility and activity in the local authority."
          },
          "energyEfficiency": {
            "type": "string",
            "description": "Energy ratings in the postcode sector."
          },
          "dataQuality": {
            "type": "string",
            "description": "How complete the details behind the estimate were."
          },
          "marketSignals": {
            "type": "string",
            "description": "What the live market signals say, in words. The figures are never adjusted for them.\nAbsent when the area's market data was unavailable.\n"
          },
          "areaInsights": {
            "type": "object",
            "description": "The area's market data in words. Each is absent when its data was unavailable, and\nthe object is absent when all are.\n",
            "properties": {
              "seasonality": {
                "type": "string",
                "description": "The best and worst months to buy or sell."
              },
              "growth": {
                "type": "string",
                "description": "Long-run price growth, before and after inflation, and volatility."
              },
              "benchmark": {
                "type": "string",
                "description": "Local growth against the region."
              },
              "priceVelocity": {
                "type": "string",
                "description": "How fast prices are moving, and which way."
              },
              "marketStructure": {
                "type": "string",
                "description": "The mix of property types and tenures."
              },
              "timing": {
                "type": "string",
                "description": "Whether conditions favour buyers or sellers."
              },
              "recovery": {
                "type": "string",
                "description": "Past price falls and how long prices took to recover."
              },
              "investors": {
                "type": "string",
                "description": "Short holds and investor interest."
              },
              "resaleReturns": {
                "type": "string",
                "description": "Gains on homes sold more than once."
              },
              "newBuild": {
                "type": "string",
                "description": "The new-build premium or discount."
              },
              "propertyTypes": {
                "type": "string",
                "description": "Which property types do better or worse locally."
              },
              "streets": {
                "type": "string",
                "description": "The top streets by price and by growth."
              },
              "priceSpread": {
                "type": "string",
                "description": "Entry-level against premium prices."
              },
              "overview": {
                "type": "string",
                "description": "The picture as a whole."
              }
            }
          },
          "disclaimer": {
            "type": "string",
            "description": "The estimate is automated and is not a formal valuation."
          }
        }
      },
      "RebuildCost": {
        "type": "object",
        "description": "An indicative cost to rebuild the house, for buildings insurance: works, fees and\ndemolition, never the land. Present only when `include` asked for it, and free. It is\nworked out from the details you sent, so the home's construction and whether it is\nlisted are not checked. A range when `estimated` is true; otherwise the `reason`.\n",
        "required": [
          "estimated"
        ],
        "properties": {
          "estimated": {
            "type": "boolean",
            "description": "True when the range is given."
          },
          "reason": {
            "type": "string",
            "enum": [
              "flat",
              "size",
              "unavailable"
            ],
            "description": "Why there is no range: `flat`, since a flat is insured on the block's policy; `size`,\na floor area outside the sizes the building cost rates cover; `unavailable`, when it\ncould not be worked out just now. Absent when `estimated` is true.\n"
          },
          "low": {
            "type": "integer",
            "description": "In pounds, to the nearest 1,000.",
            "example": 196000
          },
          "typical": {
            "type": "integer",
            "description": "In pounds, to the nearest 1,000.",
            "example": 231000
          },
          "high": {
            "type": "integer",
            "description": "In pounds, to the nearest 1,000.",
            "example": 277000
          },
          "pricesAsOf": {
            "type": "string",
            "description": "The month the construction prices run to.",
            "example": "2026-06"
          }
        }
      },
      "StreetAnalysis": {
        "type": "object",
        "required": [
          "postcode",
          "coveredPostcodes",
          "transport",
          "generatedAt"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "test"
            ],
            "description": "Present only in test mode. Never show a test result to a customer."
          },
          "postcode": {
            "type": "string",
            "example": "M1 1AE"
          },
          "coveredPostcodes": {
            "type": "array",
            "description": "The postcodes the figures are drawn from, the one asked for first.",
            "items": {
              "type": "string"
            },
            "example": [
              "M1 1AE",
              "M1 1AF"
            ]
          },
          "soldPrices": {
            "type": "object",
            "nullable": true,
            "description": "HM Land Registry Price Paid sales in the covered postcodes. Null when there are none.",
            "properties": {
              "totalSold": {
                "type": "integer",
                "example": 214
              },
              "firstSale": {
                "type": "string",
                "example": "1995-03-01"
              },
              "lastSale": {
                "type": "string",
                "example": "2026-06-12"
              },
              "overallMedian": {
                "type": "integer",
                "example": 182000
              },
              "overallAverage": {
                "type": "integer",
                "example": 196500
              },
              "recentMedian": {
                "type": "integer",
                "description": "The median over the last `recentMedianYears` years.",
                "example": 205000
              },
              "recentMedianYears": {
                "type": "integer",
                "example": 3
              },
              "highestSale": {
                "type": "integer",
                "example": 610000
              },
              "lowestSale": {
                "type": "integer",
                "example": 40000
              },
              "byYear": {
                "type": "array",
                "description": "Oldest year first.",
                "items": {
                  "type": "object",
                  "properties": {
                    "year": {
                      "type": "integer",
                      "example": 2025
                    },
                    "average": {
                      "type": "integer",
                      "example": 205123
                    },
                    "median": {
                      "type": "integer",
                      "example": 199000
                    },
                    "sales": {
                      "type": "integer",
                      "example": 14
                    }
                  }
                }
              }
            }
          },
          "crime": {
            "type": "object",
            "nullable": true,
            "description": "Street-level crime reported to police.uk near the postcode, for the latest month published.",
            "properties": {
              "month": {
                "type": "string",
                "example": "2026-07"
              },
              "byType": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "crimeType": {
                      "type": "string",
                      "example": "anti-social-behaviour"
                    },
                    "crimeCount": {
                      "type": "integer",
                      "example": 41
                    }
                  }
                }
              }
            }
          },
          "transport": {
            "type": "array",
            "description": "Stops near the postcode, by name, mode and how far away. Never their coordinates.",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "Manchester Piccadilly"
                },
                "mode": {
                  "type": "string",
                  "enum": [
                    "rail",
                    "metro",
                    "bus",
                    "air",
                    "ferry",
                    "other"
                  ]
                },
                "distanceBand": {
                  "type": "string",
                  "enum": [
                    "under 500 m",
                    "500 m to 1 km",
                    "1 to 2 km",
                    "over 2 km"
                  ]
                }
              }
            }
          },
          "rental": {
            "type": "object",
            "nullable": true,
            "description": "Private rents and yields for the area (ONS Price Index of Private Rents).",
            "properties": {
              "averageRent": {
                "type": "number",
                "description": "Monthly, in pounds.",
                "example": 1180
              },
              "grossYield": {
                "type": "number",
                "nullable": true,
                "example": 6.1
              },
              "netYield": {
                "type": "number",
                "nullable": true,
                "example": 4.6
              },
              "rentGrowth": {
                "type": "number",
                "description": "Annual change, in percent.",
                "example": 7.2
              },
              "rentToIncome": {
                "type": "number",
                "nullable": true
              },
              "basis": {
                "type": "string",
                "nullable": true,
                "description": "The geography the yield is measured over.",
                "example": "local_authority"
              },
              "byBedroom": {
                "type": "object",
                "description": "Rent and its annual change for one, two, three and four or more bedrooms, where published."
              },
              "byPropertyType": {
                "type": "object",
                "description": "Rent and its annual change by property type, where published."
              }
            }
          },
          "energy": {
            "type": "object",
            "nullable": true,
            "description": "Metered gas and electricity use (DESNZ), against the England and Wales median.",
            "properties": {
              "year": {
                "type": "integer",
                "example": 2024
              },
              "granularity": {
                "type": "string",
                "example": "postcode"
              },
              "electricity": {
                "$ref": "#/components/schemas/FuelUse"
              },
              "electricityEconomy7": {
                "$ref": "#/components/schemas/FuelUse"
              },
              "gas": {
                "$ref": "#/components/schemas/FuelUse"
              },
              "gasPenetration": {
                "type": "number",
                "nullable": true
              },
              "vsElectricityPct": {
                "type": "number",
                "nullable": true
              },
              "vsGasPct": {
                "type": "number",
                "nullable": true
              },
              "englandWalesElectricityMedianKwh": {
                "type": "number",
                "nullable": true
              },
              "englandWalesGasMedianKwh": {
                "type": "number",
                "nullable": true
              }
            }
          },
          "priceIndex": {
            "type": "object",
            "nullable": true,
            "description": "The UK House Price Index for the local authority, newest month first, up to 24 months.",
            "properties": {
              "localAuthority": {
                "type": "string",
                "example": "E08000003"
              },
              "months": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "month": {
                      "type": "string",
                      "example": "2026-06"
                    },
                    "averagePrice": {
                      "type": "integer",
                      "nullable": true,
                      "example": 232500
                    },
                    "index": {
                      "type": "number",
                      "nullable": true,
                      "example": 151.2
                    },
                    "twelveMonthChangePct": {
                      "type": "number",
                      "nullable": true,
                      "example": 2.4
                    },
                    "salesVolume": {
                      "type": "integer",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the figures were put together."
          },
          "charge": {
            "type": "object",
            "description": "Credits this call used, and your balance afterwards. Absent in test mode and on a free repeat.",
            "required": [
              "credits",
              "balanceAfter"
            ],
            "properties": {
              "credits": {
                "type": "integer",
                "example": 6
              },
              "balanceAfter": {
                "type": "integer",
                "example": 2484
              }
            }
          }
        }
      },
      "FuelUse": {
        "type": "object",
        "nullable": true,
        "properties": {
          "medianKwh": {
            "type": "number",
            "example": 2700
          },
          "meanKwh": {
            "type": "number",
            "example": 3000
          },
          "meters": {
            "type": "integer",
            "example": 40
          }
        }
      },
      "Problem": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "description": "RFC 9457 problem details.",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "Identifies the error, and opens a page that explains it. Branch on this.",
            "example": "https://developers.checkmystreet.co.uk/errors/outside-coverage"
          },
          "title": {
            "type": "string",
            "description": "A short, fixed summary of the type.",
            "example": "Outside coverage"
          },
          "status": {
            "type": "integer",
            "example": 422
          },
          "detail": {
            "type": "string",
            "description": "What went wrong with this request, in words. Log it rather than parse it.",
            "example": "We value properties in England and Wales. EH1 1 is in Scotland."
          },
          "code": {
            "type": "string",
            "description": "A more specific reason within the type.",
            "example": "unknown_sector"
          }
        }
      }
    },
    "responses": {
      "InvalidRequest": {
        "description": "`invalid-request`: malformed JSON, an unknown field, or a bad value.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://developers.checkmystreet.co.uk/errors/invalid-request",
              "title": "Invalid request",
              "status": 400,
              "detail": "propertyType must be one of detached, semi_detached, terraced, flat.",
              "code": "invalid_value"
            }
          }
        }
      },
      "Unauthorised": {
        "description": "Missing, invalid, expired or revoked token: fetch a new one. Sent with a\n`WWW-Authenticate: Bearer error=\"invalid_token\"` header and a small JSON body, not as a\nproblem document.\n"
      },
      "Forbidden": {
        "description": "`insufficient-credits` or `account-blocked`: not allowed to spend.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://developers.checkmystreet.co.uk/errors/insufficient-credits",
              "title": "Insufficient credits",
              "status": 403,
              "detail": "This call costs 10 credits and your balance is 4."
            }
          }
        }
      },
      "NotFound": {
        "description": "`not-found`: no valuation has that id.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://developers.checkmystreet.co.uk/errors/not-found",
              "title": "Not found",
              "status": 404,
              "detail": "No valuation with the id val_01j9xk2q7m4t8v6r3c5b0n1a2e."
            }
          }
        }
      },
      "RequestInProgress": {
        "description": "`request-in-progress`: a request with this `Idempotency-Key` is still running.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://developers.checkmystreet.co.uk/errors/request-in-progress",
              "title": "Request in progress",
              "status": 409,
              "detail": "A request with this Idempotency-Key is still running. Retry shortly with the same key."
            }
          }
        }
      },
      "CannotBeValued": {
        "description": "`outside-coverage`, `floor-area-required` or `idempotency-key-reused`.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://developers.checkmystreet.co.uk/errors/outside-coverage",
              "title": "Outside coverage",
              "status": 422,
              "detail": "We value properties in England and Wales. EH1 1 is in Scotland.",
              "code": "unknown_sector"
            }
          }
        }
      },
      "RateLimited": {
        "description": "`rate-limited`: too many requests in a short time, or, with `code` `daily_limit`, the account's daily limit is used: do not retry before midnight UTC.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before you retry.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://developers.checkmystreet.co.uk/errors/rate-limited",
              "title": "Rate limited",
              "status": 429,
              "detail": "Too many requests. Retry after 5 seconds."
            }
          }
        }
      },
      "DataUnavailable": {
        "description": "`data-unavailable`: something the result depends on was unavailable. Never charged.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://developers.checkmystreet.co.uk/errors/data-unavailable",
              "title": "Data unavailable",
              "status": 503,
              "detail": "A data source was unavailable. Retry shortly with the same Idempotency-Key."
            }
          }
        }
      },
      "Timeout": {
        "description": "`timeout`: the request ran past 30 seconds. Retry with the same `Idempotency-Key`.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://developers.checkmystreet.co.uk/errors/timeout",
              "title": "Timeout",
              "status": 504,
              "detail": "The request took longer than 30 seconds. Retry with the same Idempotency-Key."
            }
          }
        }
      }
    }
  }
}
