Name API — First name validation

Support DQE
Support DQE
  • Updated
Name API - Suggest first names

Use this endpoint to suggest first names based on user input.

Related Name documentation - For a service overview, see Name API — Introduction →
For last name suggestions, see Name API — Last name validation →

/FIRSTNAMESUGGEST/

Request

Both GET and POST are supported.

{SERVER_ADDRESS} and {LICENCE_CODE} are provided by DQE upon account creation. Contact your DQE account manager to obtain these credentials.
GEThttps://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?Firstname={FIRST_NAME}&Gender={GENDER}&NBResponse={NUM}&Licence={LICENCE_CODE}&Country={COUNTRY_CODE}&Format={FORMAT}&Verifname=Y

Code examples

First name suggestion

curl "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?Firstname=Ali&Gender=F&NBResponse=10&Country=FRA&Format=0&Licence={LICENCE_CODE}"
fetch("https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?" + new URLSearchParams({ Firstname: "Ali", Gender: "F", NBResponse: "10", Country: "FRA", Format: "0", Licence: "{LICENCE_CODE}" })) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.get( "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/", params={ "Firstname": "Ali", "Gender": "F", "NBResponse": "10", "Country": "FRA", "Format": "0", "Licence": "{LICENCE_CODE}", }, ) print(response.json())
<?php $params = http_build_query([ 'Firstname' => 'Ali', 'Gender' => 'F', 'NBResponse' => '10', 'Country' => 'FRA', 'Format' => '0', 'Licence' => '{LICENCE_CODE}', ]); $ch = curl_init("https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?{$params}"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true);
const axios = require('axios'); axios.get('https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/', { params: { Firstname: 'Ali', Gender: 'F', NBResponse: '10', Country: 'FRA', Format: '0', Licence: '{LICENCE_CODE}' } }) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String url = "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/" + "?Firstname=Ali&Gender=F&NBResponse=10&Country=FRA&Format=0&Licence={LICENCE_CODE}"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .GET() .build(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body());
using var client = new HttpClient(); var url = "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/" + "?Firstname=Ali&Gender=F&NBResponse=10&Country=FRA&Format=0&Licence={LICENCE_CODE}"; var response = await client.GetAsync(url); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
package main import ( "fmt" "io" "net/http" ) func main() { url := "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/" + "?Firstname=Ali&Gender=F&NBResponse=10&Country=FRA&Format=0&Licence={LICENCE_CODE}" resp, err := http.Get(url) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) }
POSThttps://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/

Send all parameters in the request body using Content-Type: application/x-www-form-urlencoded. The server address remains in the URL.

Code examples

First name suggestion

curl -X POST "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "Licence={LICENCE_CODE}" \ -d "Firstname=Ali" \ -d "Gender=F" \ -d "NBResponse=10" \ -d "Country=FRA" \ -d "Format=0"
fetch("https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ Licence: "{LICENCE_CODE}", Firstname: "Ali", Gender: "F", NBResponse: "10", Country: "FRA", Format: "0" }) }) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.post( "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/", data={ "Licence": "{LICENCE_CODE}", "Firstname": "Ali", "Gender": "F", "NBResponse": "10", "Country": "FRA", "Format": "0", }, ) print(response.json())
<?php $ch = curl_init("https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ 'Licence' => '{LICENCE_CODE}', 'Firstname' => 'Ali', 'Gender' => 'F', 'NBResponse' => '10', 'Country' => 'FRA', 'Format' => '0', ])); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true);
const axios = require('axios'); const qs = require('querystring'); axios.post('https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/', qs.stringify({ Licence: '{LICENCE_CODE}', Firstname: 'Ali', Gender: 'F', NBResponse: '10', Country: 'FRA', Format: '0' })) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String form = "Licence={LICENCE_CODE}&Firstname=Ali&Gender=F&NBResponse=10&Country=FRA&Format=0"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/")) .header("Content-Type", "application/x-www-form-urlencoded") .POST(HttpRequest.BodyPublishers.ofString(form)) .build(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body());
using var client = new HttpClient(); var form = new Dictionary<string, string> { ["Licence"] = "{LICENCE_CODE}", ["Firstname"] = "Ali", ["Gender"] = "F", ["NBResponse"] = "10", ["Country"] = "FRA", ["Format"] = "0" }; var response = await client.PostAsync( "https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/", new FormUrlEncodedContent(form)); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
package main import ( "fmt" "io" "net/http" "net/url" ) func main() { form := url.Values{} form.Set("Licence", "{LICENCE_CODE}") form.Set("Firstname", "Ali") form.Set("Gender", "F") form.Set("NBResponse", "10") form.Set("Country", "FRA") form.Set("Format", "0") resp, err := http.PostForm("https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/", form) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) }

Parameters

Parameter Description Mand / Opt
Licence Licence code assigned to your account. Mandatory
Firstname Part of the first name already entered by the user. Mandatory
Gender M, F, or I. Optional
NBResponse Maximum number of suggestions to return. Default: 10. Optional
Country ISO 3-letter country code used to prioritize suggestions. Optional
Format Desired output format. Default: 0. Optional
Verifname Checks whether the first name exists without autocomplete (pass Y). Optional

Format values

Format Description
0 First name in uppercase without accents.
1 First letter uppercase without accents.
2 First name in lowercase without accents.
3 First name in uppercase with accents.
4 First letter uppercase with accents.
5 First name in lowercase with accents.

Response

The JSON response is a dictionary containing the suggest key. Its value is an array of suggested items. Each item is an array of two strings: the first value is the gender of the first name (M, F, or I), and the second value is the suggested first name.

Key Possible values Description Type
suggest[X][0] F, M, I Gender of the suggested first name — F: feminine, M: masculine, I: unknown. STRING(1)
suggest[X][1] — Suggested first name. STRING(255)

Response example

{
  "suggest": [
    ["F", "ALICE"],
    ["F", "ALICE-ANNE"],
    ["F", "ALICE-MARIE"]
  ]
}

Errors

Error type Request example Response body
Missing, empty, or incorrect Licence parameter https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?Firstname=Ali&Gender=F&NBResponse=10
{}
Missing or empty Firstname parameter https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?Gender=F&NBResponse=10&Licence={LICENCE_CODE}
{"suggest": []}
Parameter typo https://{SERVER_ADDRESS}/FIRSTNAMESUGGEST/?Firtname=Ali&Gender=F&NBResponse=10&Licence={LICENCE_CODE}
{"suggest": []}

Test the API

Click the button below to test this endpoint live in your browser.

Open console

See also

Related to

Was this article helpful?

0 out of 0 found this helpful