Recipes

Recipes

The following code snippets are helpful to start using the service.

Filter by country

curl 'https://api.teslahunt.io/cars' \
  --get \
  --data-urlencode 'filterByFormula=AND({country} = "Italy")' \
  --header 'x-api-key: YOUR_TOKEN'

Filter by currency

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

Filter by model

curl 'https://api.teslahunt.io/cars' \
  --get \
  --data-urlencode 'filterByFormula=AND({modelLetter} = "3")' \
  --header 'x-api-key: YOUR_TOKEN'

Filter by odometer

curl 'https://api.teslahunt.io/cars' \
  --get \
  --data-urlencode 'filterByFormula=AND({odometer} < 80000)' \
  --header 'x-api-key: YOUR_TOKEN'

Filter by option codes

curl 'https://api.teslahunt.io/cars' \
  --get \
  --data-urlencode 'filterByFormula=AND(FIND("PPPA",{optionCodes}),FIND("PBSB",{optionCodes}))' \
  --header 'x-api-key: YOUR_TOKEN'

Filter by price

curl 'https://api.teslahunt.io/cars' \
  --get \
  --data-urlencode 'filterByFormula=AND({price} < 40000)' \
  --header 'x-api-key: YOUR_TOKEN'

Filter by tax presence

curl 'https://api.teslahunt.io/cars' \
  --get \
  --data-urlencode 'filterByFormula=NOT(tax = BLANK())' \
  --header 'x-api-key: YOUR_TOKEN'

Filter by title

curl 'https://api.teslahunt.io/cars' \
  --get \
  --data-urlencode 'filterByFormula=FIND('Long Range',{title})' \
  --header 'x-api-key: YOUR_TOKEN'

Filter by year

curl 'https://api.teslahunt.io/cars' \
  --get \
  --data-urlencode 'filterByFormula=AND({year} >= 2016)' \
  --header 'x-api-key: YOUR_TOKEN'