> This page is for Analytics API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://documentation.babelstreet.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://documentation.babelstreet.com/_mcp/server.

# Match pairs of records

POST https://analytics.babelstreet.com/rest/v1/record-similarity
Content-Type: application/json

Compares records and returns a similarity score for each pair. Set `comparisonMethod` to control pairing: `one_to_one` (default), `one_to_n` (single record on one side compared to every record on the other side), or `n_to_m` (every left record compared to every right record). The fields in the records can be any of the following entity types: PERSON, ORGANIZATION, ADDRESS, DATE, or IDENTIFIER/TEXT. The records do not have to contain the same fields; only fields with the same field name are compared. If one record has three fields and the other has two fields, the missing field will be ignored and the other two fields compared. Each field can contain one or multiple values.

Reference: https://documentation.babelstreet.com/analytics/match-names/record-similarity/match-pairs-of-records

## Authentication

- `X-BabelStreetAPI-Key` header (required) — API Key authentication via header
- `X-RosetteAPI-Key` header (required) — API Key authentication via header

## Servers

- `https://analytics.babelstreet.com/rest/v1` (https://analytics.babelstreet.com/rest/v1/, default)
- `https://api.rosette.com/rest/v1` (https://api.rosette.com/rest/v1/)

## Request

### Body (application/json)

This endpoint expects a RecordRequest.

- `comparisonMethod` (enum, optional, default: one_to_one) — Controls how input records are paired before scoring. Defaults to `one_to_one`, which preserves existing behavior.
  - Allowed values: `one_to_one`, `one_to_n`, `n_to_m`
- `fields` (Fields, optional)
- `properties` (Properties, optional)
- `records` (Records, optional) — Records to compare. At least one of `left` or `right` must contain a record. Two equally sized lists are matched by position. A single record on one side is matched against every record on the other side.

## Response

### 200

OK

- `fields` (Fields, optional)
- `results` (list of Results, optional)

## Types

### Fields

- `type` (enum, optional)
  - Allowed values: `rni_name`, `rni_address`, `rni_date`, `rni_string`, `rni_number`, `rni_boolean`
- `weight` (double, optional) — value indicating weighting
- `scoringMethod` (enum, optional) — how this field contributes to the overall score, where default behavior is STANDARD, ONLY_INCREASE means the field can only contribute to an increase in the overall score if it is an exact match, and ONLY_DECREASE means the field can only contribute to a decrease in the overall score if it is not an exact match
  - Allowed values: `STANDARD`, `ONLY_INCREASE`, `ONLY_DECREASE`

### Properties

- `threshold` (double, optional) — results must be greater than threshold to be returned
- `includeExplainInfo` (boolean, optional) — true returns the full details of how the records matched
- `matchingFieldsBoostBias` (double, optional, default: 1) — a value that applies a bias to the final score for each exact matching field in both records (the default value of 1.0 will not change the score)

### Records

Records to compare. At least one of `left` or `right` must contain a record. Two equally sized lists are matched by position. A single record on one side is matched against every record on the other side.

- `left` (list of list of FieldProperties, optional) — The left-side records, or the records for an all-pairs match when `right` is omitted.
- `right` (list of list of FieldProperties, optional) — The right-side records, or the records for an all-pairs match when `left` is omitted.

### Results

- `score` (double, optional)
- `left` (RecordResponseFields, optional)
- `right` (RecordResponseFields, optional)
- `explainInfo` (ExplainInfo, optional)
- `leftOnlyFields` (list of string, optional)
- `rightOnlyFields` (list of string, optional)

### FieldProperties

- `namefieldname` (FieldPropertiesNamefieldname, optional)
- `datefieldname` (FieldPropertiesDatefieldname, optional)
- `addressfieldname` (FieldPropertiesAddressfieldname, optional)

### RecordResponseFields

- Names: Names
- Dates: Dates
- AddressResp: AddressResp

### ExplainInfo

- ScoredFieldsName: ScoredFieldsName
- ScoredFieldsAddress: ScoredFieldsAddress
- ScoredFieldsDate: ScoredFieldsDate

### FieldPropertiesNamefieldname

- NameProperties: NameProperties
- list of NameProperties

### FieldPropertiesDatefieldname

- DateProperties: DateProperties
- list of DateProperties

### FieldPropertiesAddressfieldname

- AddressProperties: AddressProperties
- list of AddressProperties

### Names

- `fieldname` (NamesFieldname, optional)

### Dates

- `fieldname` (DatesFieldname, optional)

### AddressResp

- `fieldname` (AddressRespFieldname, optional)

### ScoredFieldsName

- `fieldname` (ScoredFieldsNameFieldname, optional)

### ScoredFieldsAddress

- `fieldname` (ScoredFieldsAddressFieldname, optional)

### ScoredFieldsDate

- `fieldname` (ScoredFieldsDateFieldname, optional)

### NameProperties

- `text` (string, optional)
- `language` (string, optional)
- `entityType` (enum, optional) — the entity type of the object
  - Allowed values: `PERSON`, `LOCATION`, `ORGANIZATION`
- `languageOfOrigin` (string, optional) — ISO 639-3 code for the name's language
- `script` (string, optional) — ISSO 15924 code for the name's script

### DateProperties

- `date` (string, optional)

### AddressProperties

- `address` (string, optional)

### NamesFieldname

- `text` (string, optional)

### DatesFieldname

- `date` (string, optional)

### AddressRespFieldname

- `address` (string, optional)

### ScoredFieldsNameFieldname

- `weight` (double, optional)
- `calculatedWeight` (double, optional)
- `rawScore` (double, optional)
- `finalScore` (double, optional)
- `details` (ScoredFieldsNameFieldnameDetails, optional)

### ScoredFieldsAddressFieldname

- `weight` (double, optional)
- `calculatedWeight` (double, optional)
- `rawScore` (double, optional)
- `finalScore` (double, optional)
- `details` (ScoredFieldsAddressFieldnameDetails, optional)

### ScoredFieldsDateFieldname

- `weight` (double, optional)
- `calculatedWeight` (double, optional)
- `rawScore` (double, optional)
- `finalScore` (double, optional)
- `details` (ScoredFieldsDateFieldnameDetails, optional)

### ScoredFieldsNameFieldnameDetails

- `leftInput` (NameDetails, optional)
- `rightInput` (NameDetails, optional)
- `scoreTuples` (list of ScoreTuples, optional)
- `scoreAdjustments` (ScoreAdjustments, optional)
- `finalScore` (double, optional)
- `defaultInput` (ScoredFieldsNameFieldnameDetailsDefaultInput, optional)
- `empty` (boolean, optional)

### ScoredFieldsAddressFieldnameDetails

- `leftInput` (AddressDetails, optional)
- `rightInput` (AddressDetails, optional)
- `scoreTuples` (list of ScoreTuplesAddress, optional)
- `scoreAdjustments` (ScoreAdjustments, optional)
- `finalScore` (double, optional)
- `fieldScores` (list of FieldScores, optional)
- `empty` (boolean, optional)
- `defaultInput` (ScoredFieldsAddressFieldnameDetailsDefaultInput, optional)

### ScoredFieldsDateFieldnameDetails

- `leftInput` (DateDetails, optional)
- `rightInput` (DateDetails, optional)
- `scoreTuples` (list of ScoreTuplesDate, optional)
- `scoreAdjustments` (ScoreAdjustments, optional)
- `finalScore` (double, optional)
- `scores` (list of ScoreTuples, optional)
- `defaultInput` (ScoredFieldsDateFieldnameDetailsDefaultInput, optional)
- `empty` (boolean, optional)

### NameDetails

- `data` (string, optional)
- `normalizedData` (string, optional)
- `latnData` (string, optional)
- `script` (string, optional)
- `languageOfUse` (string, optional)
- `languageOfOrigin` (string, optional)
- `tokens` (list of Tokens, optional)
- `entityType` (string, optional)
- `empty` (boolean, optional)

### ScoreTuples

- `scoreinIsolation` (double, optional)
- `scoreInContext` (double, optional)
- `left` (string, optional)
- `right` (string, optional)
- `marked` (boolean, optional)
- `reason` (string, optional)
- `leftMinTokenIndex` (double, optional)
- `leftMaxTokenIndex` (double, optional)
- `rightMinTokenIndex` (double, optional)
- `rightMaxTokenIndex` (double, optional)

### ScoreAdjustments

- `unbiasedScore` (double, optional)
- `score` (double, optional)
- `parameter` (string, optional)

### ScoredFieldsNameFieldnameDetailsDefaultInput

- `empty` (string, optional)

### AddressDetails

- `fieldInputInfos` (list of FieldInputInfo, optional)
- `empty` (boolean, optional)

### ScoreTuplesAddress

- `scoreinIsolation` (double, optional)
- `scoreInContext` (double, optional)
- `left` (string, optional)
- `right` (string, optional)
- `marked` (boolean, optional)
- `reason` (string, optional)
- `leftMinTokenIndex` (double, optional)
- `leftMaxTokenIndex` (double, optional)
- `rightMinTokenIndex` (double, optional)
- `rightMaxTokenIndex` (double, optional)
- `leftField` (string, optional)
- `rightField` (string, optional)

### FieldScores

- `leftField` (string, optional)
- `rightField` (string, optional)
- `score` (double, optional)
- `marked` (boolean, optional)

### ScoredFieldsAddressFieldnameDetailsDefaultInput

- `empty` (boolean, optional)

### DateDetails

- `originalString` (string, optional)
- `day` (double, optional)
- `month` (double, optional)
- `yearWithoutCentury` (double, optional)
- `century` (double, optional)
- `modifiedJulianDay` (double, optional)
- `canonicalForm` (string, optional)
- `empty` (boolean, optional)

### ScoreTuplesDate

- `scoreinIsolation` (double, optional)
- `scoreInContest` (double, optional)
- `left` (string, optional)
- `right` (string, optional)
- `marked` (boolean, optional)
- `weight` (double, optional)
- `component` (string, optional)

### ScoredFieldsDateFieldnameDetailsDefaultInput

- `empty` (boolean, optional)

### Tokens

- `token` (string, optional)
- `latnTokn` (string, optional)
- `tokenWeight` (double, optional)
- `bin` (double, optional)
- `biasedBin` (double, optional)
- `tokenType` (string, optional)

### FieldInputInfo

- `data` (string, optional)
- `normalizedData` (string, optional)
- `latnData` (string, optional)
- `script` (string, optional)
- `languageOfUse` (string, optional)
- `languageOfOrigin` (string, optional)
- `tokens` (list of AddTokens, optional)
- `addressField` (string, optional)
- `empty` (boolean, optional)

### AddTokens

- `token` (string, optional)
- `latnToken` (string, optional)
- `tokenWeight` (double, optional)

## Examples

**Request**

```json
{
  "fields": {
    "dob": {
      "type": "rni_date",
      "weight": 0.1
    },
    "primaryName": {
      "type": "rni_name",
      "weight": 0.5
    }
  },
  "properties": {
    "threshold": 0.7,
    "includeExplainInfo": true
  },
  "records": {
    "left": [
      [
        {
          "dob": {
            "date": "1993-04-16"
          }
        },
        {
          "primaryName": {
            "text": "Ethan R",
            "entityType": "PERSON",
            "language": "eng",
            "languageOfOrigin": "eng",
            "script": "Latn"
          }
        }
      ],
      [
        {
          "dob": {
            "date": "1993-04-16"
          }
        },
        {
          "primaryName": [
            {
              "text": "Evan R",
              "entityType": "PERSON",
              "language": "eng"
            },
            {
              "text": "Evan Rosenstein",
              "entityType": "PERSON",
              "language": "eng"
            }
          ]
        }
      ]
    ],
    "right": [
      [
        {
          "dob": {
            "date": "1993-04-16"
          }
        },
        {
          "primaryName": {
            "text": "Evan R",
            "entityType": "PERSON",
            "language": "eng"
          }
        }
      ],
      [
        {
          "dob": {
            "date": "1993-04-16"
          }
        },
        {
          "primaryName": {
            "text": "Ivan R",
            "entityType": "PERSON",
            "language": "eng"
          }
        }
      ]
    ]
  }
}
```

**Response**

```json
{
  "fields": {},
  "results": [
    {
      "score": 1.1,
      "left": {
        "fieldname": {
          "text": "string"
        }
      },
      "right": {
        "fieldname": {
          "text": "string"
        }
      },
      "explainInfo": {
        "fieldname": {
          "weight": 1.1,
          "calculatedWeight": 1.1,
          "rawScore": 1.1,
          "finalScore": 1.1,
          "details": {
            "leftInput": {
              "data": "string",
              "normalizedData": "string",
              "latnData": "string",
              "script": "string",
              "languageOfUse": "string",
              "languageOfOrigin": "string",
              "tokens": [
                {
                  "token": "string",
                  "latnTokn": "string",
                  "tokenWeight": 1.1,
                  "bin": 1.1,
                  "biasedBin": 1.1,
                  "tokenType": "string"
                }
              ],
              "entityType": "string",
              "empty": true
            },
            "rightInput": {
              "data": "string",
              "normalizedData": "string",
              "latnData": "string",
              "script": "string",
              "languageOfUse": "string",
              "languageOfOrigin": "string",
              "tokens": [
                {
                  "token": "string",
                  "latnTokn": "string",
                  "tokenWeight": 1.1,
                  "bin": 1.1,
                  "biasedBin": 1.1,
                  "tokenType": "string"
                }
              ],
              "entityType": "string",
              "empty": true
            },
            "scoreTuples": [
              {
                "scoreinIsolation": 1.1,
                "scoreInContext": 1.1,
                "left": "string",
                "right": "string",
                "marked": true,
                "reason": "string",
                "leftMinTokenIndex": 1.1,
                "leftMaxTokenIndex": 1.1,
                "rightMinTokenIndex": 1.1,
                "rightMaxTokenIndex": 1.1
              }
            ],
            "scoreAdjustments": {
              "unbiasedScore": 1.1,
              "score": 1.1,
              "parameter": "string"
            },
            "finalScore": 1.1,
            "defaultInput": {
              "empty": "string"
            },
            "empty": true
          }
        }
      },
      "leftOnlyFields": [
        "string"
      ],
      "rightOnlyFields": [
        "string"
      ]
    }
  ]
}
```

**SDK Code**

```python Name and birthdate
import requests

url = "https://analytics.babelstreet.com/rest/v1/record-similarity"

payload = {
    "fields": {
        "dob": {
            "type": "rni_date",
            "weight": 0.1
        },
        "primaryName": {
            "type": "rni_name",
            "weight": 0.5
        }
    },
    "properties": {
        "threshold": 0.7,
        "includeExplainInfo": True
    },
    "records": {
        "left": [[{ "dob": { "date": "1993-04-16" } }, { "primaryName": {
                        "text": "Ethan R",
                        "entityType": "PERSON",
                        "language": "eng",
                        "languageOfOrigin": "eng",
                        "script": "Latn"
                    } }], [{ "dob": { "date": "1993-04-16" } }, { "primaryName": [
                        {
                            "text": "Evan R",
                            "entityType": "PERSON",
                            "language": "eng"
                        },
                        {
                            "text": "Evan Rosenstein",
                            "entityType": "PERSON",
                            "language": "eng"
                        }
                    ] }]],
        "right": [[{ "dob": { "date": "1993-04-16" } }, { "primaryName": {
                        "text": "Evan R",
                        "entityType": "PERSON",
                        "language": "eng"
                    } }], [{ "dob": { "date": "1993-04-16" } }, { "primaryName": {
                        "text": "Ivan R",
                        "entityType": "PERSON",
                        "language": "eng"
                    } }]]
    }
}
headers = {
    "X-BabelStreetAPI-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Name and birthdate
const url = 'https://analytics.babelstreet.com/rest/v1/record-similarity';
const options = {
  method: 'POST',
  headers: {'X-BabelStreetAPI-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"fields":{"dob":{"type":"rni_date","weight":0.1},"primaryName":{"type":"rni_name","weight":0.5}},"properties":{"threshold":0.7,"includeExplainInfo":true},"records":{"left":[[{"dob":{"date":"1993-04-16"}},{"primaryName":{"text":"Ethan R","entityType":"PERSON","language":"eng","languageOfOrigin":"eng","script":"Latn"}}],[{"dob":{"date":"1993-04-16"}},{"primaryName":[{"text":"Evan R","entityType":"PERSON","language":"eng"},{"text":"Evan Rosenstein","entityType":"PERSON","language":"eng"}]}]],"right":[[{"dob":{"date":"1993-04-16"}},{"primaryName":{"text":"Evan R","entityType":"PERSON","language":"eng"}}],[{"dob":{"date":"1993-04-16"}},{"primaryName":{"text":"Ivan R","entityType":"PERSON","language":"eng"}}]]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Name and birthdate
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://analytics.babelstreet.com/rest/v1/record-similarity"

	payload := strings.NewReader("{\n  \"fields\": {\n    \"dob\": {\n      \"type\": \"rni_date\",\n      \"weight\": 0.1\n    },\n    \"primaryName\": {\n      \"type\": \"rni_name\",\n      \"weight\": 0.5\n    }\n  },\n  \"properties\": {\n    \"threshold\": 0.7,\n    \"includeExplainInfo\": true\n  },\n  \"records\": {\n    \"left\": [\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": {\n            \"text\": \"Ethan R\",\n            \"entityType\": \"PERSON\",\n            \"language\": \"eng\",\n            \"languageOfOrigin\": \"eng\",\n            \"script\": \"Latn\"\n          }\n        }\n      ],\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": [\n            {\n              \"text\": \"Evan R\",\n              \"entityType\": \"PERSON\",\n              \"language\": \"eng\"\n            },\n            {\n              \"text\": \"Evan Rosenstein\",\n              \"entityType\": \"PERSON\",\n              \"language\": \"eng\"\n            }\n          ]\n        }\n      ]\n    ],\n    \"right\": [\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": {\n            \"text\": \"Evan R\",\n            \"entityType\": \"PERSON\",\n            \"language\": \"eng\"\n          }\n        }\n      ],\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": {\n            \"text\": \"Ivan R\",\n            \"entityType\": \"PERSON\",\n            \"language\": \"eng\"\n          }\n        }\n      ]\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-BabelStreetAPI-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Name and birthdate
require 'uri'
require 'net/http'

url = URI("https://analytics.babelstreet.com/rest/v1/record-similarity")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-BabelStreetAPI-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"fields\": {\n    \"dob\": {\n      \"type\": \"rni_date\",\n      \"weight\": 0.1\n    },\n    \"primaryName\": {\n      \"type\": \"rni_name\",\n      \"weight\": 0.5\n    }\n  },\n  \"properties\": {\n    \"threshold\": 0.7,\n    \"includeExplainInfo\": true\n  },\n  \"records\": {\n    \"left\": [\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": {\n            \"text\": \"Ethan R\",\n            \"entityType\": \"PERSON\",\n            \"language\": \"eng\",\n            \"languageOfOrigin\": \"eng\",\n            \"script\": \"Latn\"\n          }\n        }\n      ],\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": [\n            {\n              \"text\": \"Evan R\",\n              \"entityType\": \"PERSON\",\n              \"language\": \"eng\"\n            },\n            {\n              \"text\": \"Evan Rosenstein\",\n              \"entityType\": \"PERSON\",\n              \"language\": \"eng\"\n            }\n          ]\n        }\n      ]\n    ],\n    \"right\": [\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": {\n            \"text\": \"Evan R\",\n            \"entityType\": \"PERSON\",\n            \"language\": \"eng\"\n          }\n        }\n      ],\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": {\n            \"text\": \"Ivan R\",\n            \"entityType\": \"PERSON\",\n            \"language\": \"eng\"\n          }\n        }\n      ]\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Name and birthdate
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://analytics.babelstreet.com/rest/v1/record-similarity")
  .header("X-BabelStreetAPI-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"fields\": {\n    \"dob\": {\n      \"type\": \"rni_date\",\n      \"weight\": 0.1\n    },\n    \"primaryName\": {\n      \"type\": \"rni_name\",\n      \"weight\": 0.5\n    }\n  },\n  \"properties\": {\n    \"threshold\": 0.7,\n    \"includeExplainInfo\": true\n  },\n  \"records\": {\n    \"left\": [\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": {\n            \"text\": \"Ethan R\",\n            \"entityType\": \"PERSON\",\n            \"language\": \"eng\",\n            \"languageOfOrigin\": \"eng\",\n            \"script\": \"Latn\"\n          }\n        }\n      ],\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": [\n            {\n              \"text\": \"Evan R\",\n              \"entityType\": \"PERSON\",\n              \"language\": \"eng\"\n            },\n            {\n              \"text\": \"Evan Rosenstein\",\n              \"entityType\": \"PERSON\",\n              \"language\": \"eng\"\n            }\n          ]\n        }\n      ]\n    ],\n    \"right\": [\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": {\n            \"text\": \"Evan R\",\n            \"entityType\": \"PERSON\",\n            \"language\": \"eng\"\n          }\n        }\n      ],\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": {\n            \"text\": \"Ivan R\",\n            \"entityType\": \"PERSON\",\n            \"language\": \"eng\"\n          }\n        }\n      ]\n    ]\n  }\n}")
  .asString();
```

```php Name and birthdate
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://analytics.babelstreet.com/rest/v1/record-similarity', [
  'body' => '{
  "fields": {
    "dob": {
      "type": "rni_date",
      "weight": 0.1
    },
    "primaryName": {
      "type": "rni_name",
      "weight": 0.5
    }
  },
  "properties": {
    "threshold": 0.7,
    "includeExplainInfo": true
  },
  "records": {
    "left": [
      [
        {
          "dob": {
            "date": "1993-04-16"
          }
        },
        {
          "primaryName": {
            "text": "Ethan R",
            "entityType": "PERSON",
            "language": "eng",
            "languageOfOrigin": "eng",
            "script": "Latn"
          }
        }
      ],
      [
        {
          "dob": {
            "date": "1993-04-16"
          }
        },
        {
          "primaryName": [
            {
              "text": "Evan R",
              "entityType": "PERSON",
              "language": "eng"
            },
            {
              "text": "Evan Rosenstein",
              "entityType": "PERSON",
              "language": "eng"
            }
          ]
        }
      ]
    ],
    "right": [
      [
        {
          "dob": {
            "date": "1993-04-16"
          }
        },
        {
          "primaryName": {
            "text": "Evan R",
            "entityType": "PERSON",
            "language": "eng"
          }
        }
      ],
      [
        {
          "dob": {
            "date": "1993-04-16"
          }
        },
        {
          "primaryName": {
            "text": "Ivan R",
            "entityType": "PERSON",
            "language": "eng"
          }
        }
      ]
    ]
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-BabelStreetAPI-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Name and birthdate
using RestSharp;

var client = new RestClient("https://analytics.babelstreet.com/rest/v1/record-similarity");
var request = new RestRequest(Method.POST);
request.AddHeader("X-BabelStreetAPI-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"fields\": {\n    \"dob\": {\n      \"type\": \"rni_date\",\n      \"weight\": 0.1\n    },\n    \"primaryName\": {\n      \"type\": \"rni_name\",\n      \"weight\": 0.5\n    }\n  },\n  \"properties\": {\n    \"threshold\": 0.7,\n    \"includeExplainInfo\": true\n  },\n  \"records\": {\n    \"left\": [\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": {\n            \"text\": \"Ethan R\",\n            \"entityType\": \"PERSON\",\n            \"language\": \"eng\",\n            \"languageOfOrigin\": \"eng\",\n            \"script\": \"Latn\"\n          }\n        }\n      ],\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": [\n            {\n              \"text\": \"Evan R\",\n              \"entityType\": \"PERSON\",\n              \"language\": \"eng\"\n            },\n            {\n              \"text\": \"Evan Rosenstein\",\n              \"entityType\": \"PERSON\",\n              \"language\": \"eng\"\n            }\n          ]\n        }\n      ]\n    ],\n    \"right\": [\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": {\n            \"text\": \"Evan R\",\n            \"entityType\": \"PERSON\",\n            \"language\": \"eng\"\n          }\n        }\n      ],\n      [\n        {\n          \"dob\": {\n            \"date\": \"1993-04-16\"\n          }\n        },\n        {\n          \"primaryName\": {\n            \"text\": \"Ivan R\",\n            \"entityType\": \"PERSON\",\n            \"language\": \"eng\"\n          }\n        }\n      ]\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Name and birthdate
import Foundation

let headers = [
  "X-BabelStreetAPI-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "fields": [
    "dob": [
      "type": "rni_date",
      "weight": 0.1
    ],
    "primaryName": [
      "type": "rni_name",
      "weight": 0.5
    ]
  ],
  "properties": [
    "threshold": 0.7,
    "includeExplainInfo": true
  ],
  "records": [
    "left": [[["dob": ["date": "1993-04-16"]], ["primaryName": [
            "text": "Ethan R",
            "entityType": "PERSON",
            "language": "eng",
            "languageOfOrigin": "eng",
            "script": "Latn"
          ]]], [["dob": ["date": "1993-04-16"]], ["primaryName": [
            [
              "text": "Evan R",
              "entityType": "PERSON",
              "language": "eng"
            ],
            [
              "text": "Evan Rosenstein",
              "entityType": "PERSON",
              "language": "eng"
            ]
          ]]]],
    "right": [[["dob": ["date": "1993-04-16"]], ["primaryName": [
            "text": "Evan R",
            "entityType": "PERSON",
            "language": "eng"
          ]]], [["dob": ["date": "1993-04-16"]], ["primaryName": [
            "text": "Ivan R",
            "entityType": "PERSON",
            "language": "eng"
          ]]]]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://analytics.babelstreet.com/rest/v1/record-similarity")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```