Authentication

Authentication

The authentication should be done providing x-api-key request header.

You should attach your API token per every request:

curl 'https://api.teslahunt.io/cars' \
  --get \
  --data-urlencode 'filterByFormula=AND({currency} = "EUR")' \
  --header 'x-api-key: YOUR_TOKEN'
 
# [
#  {
#    "url": "https://teslahunt.io/5YJ3E7EB1LF764754",
#    "photos": [
#      "https://cdn.teslahunt.io/6c84a112c0c733c7278c7dd38ffdd690/ac7d9be4/be24120d-571b-4861-a68f-7a0e70ad4dde.jpeg?ts=1650220039&userId=usr6dCZRIkbbtpdus&cs=8af3af1b8a2bc6c0",
#      "https://cdn.teslahunt.io/613e0cf6c87da1a78c7eb65cb4c9d630/e573d288/60f0784a-057b-4d0d-8487-2dc648f50bb1.jpeg?ts=1650220039&userId=usr6dCZRIkbbtpdus&cs=b7bf53b064b2ebc8"
#    ],
#    "title": "Model 3 Long Range AWD",
#    "odometer": 75813,
#    "year": 2020,
#    "country": "Italy",
#    "buyUrl": "https://www.tesla.com/it_IT/m3/order/5YJ3E7EB1LF764754?titleStatus=used&redirect=no#payment",
#    "detailsUrl": "https://www.tesla.com/it_IT/m3/order/5YJ3E7EB1LF764754?titleStatus=used&redirect=no#overview",
#    "currency": "EUR",
#    "modelLetter": "3",
#    ...

The authentication has been done successfully is HTTP response status code is 200:

curl -I 'https://api.teslahunt.io/cars' \
  --get \
  --data-urlencode 'filterByFormula=AND({currency} = "EUR")' \
  --header 'x-api-key: YOUR_TOKEN'
# HTTP/2 200

Every token credential is unique. Be sure to keep it secured. Don't share your secret API key in publicly accessible areas such as GitHub, client-side code, and so forth.

If your token credential has been compromised, please contact us.