---
title: "CURP scraping validation by data"
url: "https://developer.incode.com/api-reference/api-validate-curp-by-data-v3/"
section: "api-reference"
group: "API validations"
version: "v1.1"
status: "live"
endpoint: "POST /api/validate/curp-by-data/v3"
---
# CURP scraping validation by data

`POST /api/validate/curp-by-data/v3`

Base URL: `https://demo-api.incodesmile.com` — Incode demo environment

Check for valid CURP directly with an automated search in [https://www.gob.mx/curp/](https://www.gob.mx/curp/) and return
corresponding curp of that person. Parameters are the person's details.

Scraping service will start working asynchronously and this service will return a resultsId to fetch the results in
[/api/fetch/curp/v3](#/API%20Validations/fetchCurp3). The recommended wait time is 25 sec.

Valid values for state are the ones listed by renapo in this link: [https://es.wikipedia.org/wiki/Plantilla:Abreviaciones_de_los_estados_de_México](https://es.wikipedia.org/wiki/Plantilla:Abreviaciones_de_los_estados_de_México)

## Path & query parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `api-version` | header | string | yes | Default: `1.0` |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `curp` | string |  | User's curp. Has to be in valid format. If it isn't present, then curp value from interview is used. |
| `name` | string |  |  |
| `firstLastName` | string |  |  |
| `secondLastName` | string |  |  |
| `gender` | string |  | Valid gender values are "H" (Hombre, male), "M" (mujer, female) and "X" (otro, other) Enum: `H`, `M`, `X` |
| `birthDate` | string (dd/mm/yyyy) |  |  |
| `state` | string |  |  |
| `externalId` | string |  |  |

## Responses

### 200

idResults: String.

### 400

Bad Request

Response body (`application/json`):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `timestamp` | integer (int64) |  | UTC timestamp in milliseconds |
| `status` | integer (int32) |  | Custom error code or HTTP status code |
| `error` | string |  | HTTP status error |
| `message` | string |  | Custom error message |
| `path` | string |  | Endpoint path |
| `details` | object |  | Custom error details |

## Code samples

Generated from this endpoint's method, path, and the conventional Incode headers. The base URL is the Incode demo environment; replace `<YOUR_API_KEY>` with a key for your region.

### cURL

```bash
curl -X POST https://demo-api.incodesmile.com/api/validate/curp-by-data/v3 \
  -H "x-api-key: <YOUR_API_KEY>" \
  -H "X-Incode-Hardware-Id: <YOUR_INCODE_HARDWARE_ID>" \
  -H "api-version: 1.0" \
  -H "Content-Type: application/json"
```

### Node

```js
const res = await fetch("https://demo-api.incodesmile.com/api/validate/curp-by-data/v3", {
  method: "POST",
  headers: {
      "x-api-key": "<YOUR_API_KEY>",
      "X-Incode-Hardware-Id": "<YOUR_INCODE_HARDWARE_ID>",
      "api-version": "1.0",
      "Content-Type": "application/json",
  },
});
const data = await res.json();
```

### Python

```python
import requests

headers = {
    "x-api-key": "<YOUR_API_KEY>",
    "X-Incode-Hardware-Id": "<YOUR_INCODE_HARDWARE_ID>",
    "api-version": "1.0",
    "Content-Type": "application/json",
}
res = requests.post("https://demo-api.incodesmile.com/api/validate/curp-by-data/v3", headers=headers)
data = res.json()
```

### Java

```java
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://demo-api.incodesmile.com/api/validate/curp-by-data/v3"))
    .header("x-api-key", "<YOUR_API_KEY>")
    .header("X-Incode-Hardware-Id", "<YOUR_INCODE_HARDWARE_ID>")
    .header("api-version", "1.0")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> res = HttpClient.newHttpClient()
    .send(req, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```
require "net/http"
require "json"

uri = URI("https://demo-api.incodesmile.com/api/validate/curp-by-data/v3")
req = Net::HTTP::Post.new(uri)
req["x-api-key"] = "<YOUR_API_KEY>"
req["X-Incode-Hardware-Id"] = "<YOUR_INCODE_HARDWARE_ID>"
req["api-version"] = "1.0"
req["Content-Type"] = "application/json"

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
```

### PHP

```
$ch = curl_init("https://demo-api.incodesmile.com/api/validate/curp-by-data/v3");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "x-api-key: <YOUR_API_KEY>",
    "X-Incode-Hardware-Id: <YOUR_INCODE_HARDWARE_ID>",
    "api-version: 1.0",
    "Content-Type: application/json",
]);

$data = json_decode(curl_exec($ch), true);
curl_close($ch);
```

### Example response

```json
{}
```
