JavaScript
const apiRoot = "https://1dex.fr/api/v1";
const response = await fetch(
`${apiRoot}/public-preview?path=${
encodeURIComponent("/ville/paris-75056")
}`,
{ headers: { accept: "application/json" } },
);
const preview = await response.json();
Python
from urllib.parse import quote
from urllib.request import Request, urlopen
import json
api_root = "https://1dex.fr/api/v1"
path = quote("/ville/paris-75056", safe="")
request = Request(
f"{api_root}/public-preview?path={path}",
headers={"accept": "application/json"},
)
with urlopen(request, timeout=10) as response:
preview = json.load(response)