CityDate API — Einen Geburtsort per Postleitzahl finden

Support DQE
Support DQE
  • Aktualisiert
CityDate API - BirthLocality

Der Endpunkt BirthLocality ruft französische Orte ab, die zu einem bestimmten Datum einem Suchbegriff entsprechen.

Verwandte CityDate-Dokumentation - Der Endpunkt BirthLocality sucht Orte nach Name oder INSEE-Code. Suchen Sie stattdessen eine Gültigkeitsprüfung für ein bekanntes Geburtsdatum?
API – Beschreibung – CityDate – CPFRA →
CityDate – Einführung →

BirthLocality

Anfrage

Sowohl GET als auch POST werden unterstützt.

{SERVER_ADDRESS} und {LICENCE_CODE} werden von DQE bei der Kontoerstellung bereitgestellt. Wenden Sie sich an Ihren DQE-Kundenbetreuer, um diese Zugangsdaten zu erhalten.
GEThttps://{SERVER_ADDRESS}/BirthLocality/?BirthDate={DATE}&Search={LOOKUP}&Licence={LICENCE_CODE}&NbMax={NB_MAX}

Codebeispiele

Suche nach Ortsname

curl "https://{SERVER_ADDRESS}/BirthLocality/?BirthDate=1980-05-15&Search=PARIS&Licence={LICENCE_CODE}"
fetch("https://{SERVER_ADDRESS}/BirthLocality/?" + new URLSearchParams({ BirthDate: "1980-05-15", Search: "PARIS", Licence: "{LICENCE_CODE}" })) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.get( "https://{SERVER_ADDRESS}/BirthLocality/", params={ "BirthDate": "1980-05-15", "Search": "PARIS", "Licence": "{LICENCE_CODE}", }, ) print(response.json())
<?php $params = http_build_query([ 'BirthDate' => '1980-05-15', 'Search' => 'PARIS', 'Licence' => '{LICENCE_CODE}', ]); $ch = curl_init("https://{SERVER_ADDRESS}/BirthLocality/?{$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}/BirthLocality/', { params: { BirthDate: '1980-05-15', Search: 'PARIS', Licence: '{LICENCE_CODE}' } }) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String url = "https://{SERVER_ADDRESS}/BirthLocality/" + "?BirthDate=1980-05-15&Search=PARIS&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}/BirthLocality/" + "?BirthDate=1980-05-15&Search=PARIS&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}/BirthLocality/" + "?BirthDate=1980-05-15&Search=PARIS&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}/BirthLocality/

Senden Sie die folgenden Parameter im Request-Body im Format x-www-form-urlencoded. Die Serveradresse bleibt in der URL.

Codebeispiele

Suche nach Ortsname

curl -X POST "https://{SERVER_ADDRESS}/BirthLocality/" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "BirthDate=1980-05-15" \ -d "Search=PARIS" \ -d "Licence={LICENCE_CODE}"
fetch("https://{SERVER_ADDRESS}/BirthLocality/", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ BirthDate: "1980-05-15", Search: "PARIS", Licence: "{LICENCE_CODE}" }) }) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.post( "https://{SERVER_ADDRESS}/BirthLocality/", data={ "BirthDate": "1980-05-15", "Search": "PARIS", "Licence": "{LICENCE_CODE}", }, ) print(response.json())
<?php $ch = curl_init("https://{SERVER_ADDRESS}/BirthLocality/"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ 'BirthDate' => '1980-05-15', 'Search' => 'PARIS', 'Licence' => '{LICENCE_CODE}', ])); 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}/BirthLocality/', qs.stringify({ BirthDate: '1980-05-15', Search: 'PARIS', Licence: '{LICENCE_CODE}' })) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String form = "BirthDate=1980-05-15&Search=PARIS&Licence={LICENCE_CODE}"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://{SERVER_ADDRESS}/BirthLocality/")) .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> { ["BirthDate"] = "1980-05-15", ["Search"] = "PARIS", ["Licence"] = "{LICENCE_CODE}" }; var response = await client.PostAsync( "https://{SERVER_ADDRESS}/BirthLocality/", 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("BirthDate", "1980-05-15") form.Set("Search", "PARIS") form.Set("Licence", "{LICENCE_CODE}") resp, err := http.PostForm("https://{SERVER_ADDRESS}/BirthLocality/", form) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) }

Parameter

Parameter Beschreibung Pflicht / Optional
Licence Lizenzcode, der Ihrem Konto zugewiesen ist. Pflicht
BirthDate Datum im Format YYYY-MM-DD. Pflicht
Search Suchfeld anhand von Ortsname oder INSEE-Code. Pflicht
NbMax Maximale Anzahl der von der API zurückgegebenen Ergebnisse. Optional
Standard: 20

Antwort

Schlüssel Beschreibung Typ
Found Gesamtzahl der gefundenen Ergebnisse. INTEGER
Results Liste der zurückgegebenen Orte. ARRAY
Results.City Ortsname. STRING(50)
Results.CountyCode Kreis- oder Departement-Code. STRING(2)
Results.CountyLabel Kreis- oder Departement-Bezeichnung. STRING(50)
Results.CountryCode Länder- oder DROM-Code. STRING(2)
Results.CountryLabel Länder- oder DROM-Bezeichnung. STRING(50)
Results.CodeInsee INSEE-Code des Ortes. STRING(5)
Results.ValidityStartDate Beginn der Gültigkeit des INSEE-Codes. DATE (YYYY-MM-DD)
Results.ValidityEndDate Ende der Gültigkeit des INSEE-Codes. Leer, wenn der Code weiterhin gültig ist. DATE (YYYY-MM-DD) / NULL
Länder- / DROM-Codes - FR = Frankreich, GP = Guadeloupe, MQ = Martinique, GF = Französisch-Guayana, RE = La Réunion, YT = Mayotte, PM = Saint-Pierre und Miquelon, BL = Saint-Barthélemy, MF = Saint-Martin, PF = Französisch-Polynesien, NC = Neukaledonien, WF = Wallis und Futuna, TF = Französische Süd- und Antarktisgebiete

Antwortbeispiel

Suchergebnisse
{ "Found": 3, "Results": [ {"City": "AAST", "CountyCode": "64", "CountyLabel": "PYRENEES-ATLANTIQUES", "CountryCode": "FR", "CountryLabel": "FRANCE", "CodeInsee": "64001", "ValidityStartDate": "1943-01-01", "ValidityEndDate": ""}, {"City": "ABAINVILLE", "CountyCode": "55", "CountyLabel": "MEUSE", "CountryCode": "FR", "CountryLabel": "FRANCE", "CodeInsee": "55001", "ValidityStartDate": "1943-01-01", "ValidityEndDate": ""} ] }

Fehler

HTTP Beschreibung
400 Ungültige Anfrage oder fehlender Pflichtparameter — zum Beispiel ein fehlendes BirthDate, Search oder Licence.

API testen

Klicken Sie auf die Schaltfläche unten, um diesen Endpunkt live in Ihrem Browser zu testen.

Konsole öffnen

Siehe auch

Verknüpfung mit

War dieser Beitrag hilfreich?

0 von 0 fanden dies hilfreich