# dvf-price-m2

> French property price per m2 around an address from official DVF sales records (DGFiP / Etalab, last 3 years): median, p25/p75, count for apartments and houses within an auto-expanding radius, geocoded via Base Adresse Nationale. Not available for Alsace-Moselle and Mayotte.

- URL: https://x402-gateway.forge-x402.workers.dev/api/dvf-price-m2 (GET or POST)
- Price: 0.01 USDC on Base (10000 atomic USDC)
- MCP tool: dvf_price_m2
- Docs: https://agent-hub.dentreprise.workers.dev/tools/dvf-price-m2/

## Parameters

- `address` (string, required): French street address
- `propertyType` (string): optional: Appartement or Maison
- `surface` (number): optional surface in m2 for an estimate

## Unpaid example

```bash
curl -sS -D - "https://x402-gateway.forge-x402.workers.dev/api/dvf-price-m2?address=10+rue+de+la+Paix%2C+Paris"
```

## Example 402 challenge

```json
{
  "x402Version": 2,
  "error": "Payment required",
  "resource": {
    "url": "https://x402-gateway.forge-x402.workers.dev/api/dvf-price-m2",
    "description": "French property price per m2 around an address from official DVF sales records (DGFiP / Etalab, last 3 years): median, p25/p75, count for apartments and houses within an auto-expanding radius, geocoded via Base Adresse Nationale. Not available for Alsace-Moselle and Mayotte.",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "amount": "10000",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0x7B8bf45ac6AcbA6D4CFB626b57D3f5fF3C9C89F7",
      "maxTimeoutSeconds": 120,
      "extra": {
        "name": "USD Coin",
        "version": "2"
      }
    }
  ]
}
```

## Example response

```json
{
  "found": true,
  "geocodedLabel": "10 Rue de la Paix 75002 Paris",
  "apartmentMedianPricePerM2": 12857,
  "apartmentSales": 381,
  "houseMedianPricePerM2": 17846,
  "houseSales": 12
}
```

## Free demo / sample

The original gateway does not serve `?demo=1`. A labelled sample is published on this hub.

```bash
curl -sS "https://agent-hub.dentreprise.workers.dev/demo/dvf-price-m2.json"
```

```json
{
  "demo": true,
  "demo_label": "DEMO / SAMPLE — not live data. This is a labelled example response and was not charged.",
  "charged": false,
  "tool": "/api/dvf-price-m2",
  "docs": "https://agent-hub.dentreprise.workers.dev/tools/dvf-price-m2/",
  "how_to_get_live_data": "Call the live URL on the original gateway with an x402 v2 client (@x402/fetch or the Python package x402). This file is a labelled sample only.",
  "sample": {
    "found": true,
    "geocodedLabel": "10 Rue de la Paix 75002 Paris",
    "apartmentMedianPricePerM2": 12857,
    "apartmentSales": 381,
    "houseMedianPricePerM2": 17846,
    "houseSales": 12
  }
}
```

## Clients

- JS (x402 v2): `@x402/fetch` + `@x402/evm` (`wrapFetchWithPaymentFromConfig`, `ExactEvmScheme`). The older package `x402-fetch` is deprecated v1.
- Python: PyPI package `x402` (`x402HttpxClient` or `x402_requests`, `register_exact_evm_client`, `EthAccountSigner`).
- MCP: stdio `node src/server.mjs` in [forge-agent-mcp](https://github.com/forge-agent-hub/forge-agent-mcp); hosted Streamable HTTP at https://x402-gateway.forge-x402.workers.dev/mcp (original gateway tools).
- LangChain: wrap those clients with `DynamicStructuredTool` (`@langchain/core`) or `@tool` (`langchain_core`).
- Copy-paste snippets: https://agent-hub.dentreprise.workers.dev/tools/dvf-price-m2/ and https://agent-hub.dentreprise.workers.dev/quickstart/
