Car database REST API Car2Db.com

Car database REST API Car2Db.com

In order to use some API Car2DB method, you should send GET-query via HTTPS to the following URL.

https://api.car2db.com/api/auto/v1/entityName.actionName.format.language?params&api_key=[api_key]

entityName — requested entity:
  • type — vehicle type
  • mark — manufacturer
  • model
  • series
  • generation
  • modification — modification
  • characteristic
  • characteristicValue
  • equipment
  • option
  • optionValue
actionName — action:
  • getAll — getting all entity instances;
  • getDateUpdate — getting a date when the data was last refreshed;
format — the output data format:
  • csv — only CSV is available yet for the getAll action (first row is a column title; comma separated values in quotes);
  • timestamp — returns a Unix timestamp for the getDateUpdate action;
  • string — returns a string formated as "F j, Y, g:i a" (March 10, 2017, 5:16 pm) for the getDateUpdate action;
language — database language:
  • en — english;
  • de — deutsche;
  • pl — polish;
params — query parameters:
  • api_key — API key (token), sent after a request for );
  • id_type — vehicle type ID;

Request examples

You can see how the API works by sending requests from the user-friendly interface. For each function described the request parameters and the format of the returned data.

type

GET
/api/auto/v1/type.getAll.csv.en
Get all Vehicle types
GET
/api/auto/v1/type.getDateUpdate.timestamp.en
Get date update Vehicle types

make

GET
/api/auto/v1/make.getAll.csv.en?id_type=1
Get all Makes
GET
/api/auto/v1/make.getDateUpdate.timestamp.en?id_type=1
Get date update for Make list

model

GET
/api/auto/v1/model.getAll.csv.en?id_type=1
Get all Models
GET
/api/auto/v1/model.getDateUpdate.timestamp.en?id_type=1
Get date update for Model list

generation

GET
/api/auto/v1/generation.getAll.csv.en?id_type=1
Get all Generations
GET
/api/auto/v1/generation.getDateUpdate.timestamp.en?id_type=1
Get date update for Generation list

serie

GET
/api/auto/v1/serie.getAll.csv.en?id_type=1
Get all Series
GET
/api/auto/v1/serie.getDateUpdate.timestamp.en?id_type=1
Get date update for Series list

trim

GET
/api/auto/v1/trim.getAll.csv.en?id_type=1
Get all Trims
GET
/api/auto/v1/trim.getDateUpdate.timestamp.en?id_type=1
Get date update for Trim list

specification

GET
/api/auto/v1/specification.getAll.csv.en?id_type=1
Get all Specifications
GET
/api/auto/v1/specification.getDateUpdate.timestamp.en?id_type=1
Get date update for Specification list

specificationValue

GET
/api/auto/v1/specificationValue.getAll.csv.en?id_type=1
Get all Specification values
GET
/api/auto/v1/specificationValue.getDateUpdate.timestamp.en?id_type=1
Get date update for Specification value list

equipment

GET
/api/auto/v1/equipment.getAll.csv.en?id_type=1
Get all Equipments
GET
/api/auto/v1/equipment.getDateUpdate.timestamp.en?id_type=1
Get date update for Equipment list

option

GET
/api/auto/v1/option.getAll.csv.en?id_type=1
Get all Options
GET
/api/auto/v1/option.getDateUpdate.timestamp.en?id_type=1
Get date update for Option list

optionValue

GET
/api/auto/v1/optionValue.getAll.csv.en?id_type=1
Get all Option values
GET
/api/auto/v1/optionValue.getDateUpdate.timestamp.en?id_type=1
Get date update for Option value list

Error codes

You should assume that errors may occur in the request result. It returns as error codes of the HTTP request.

401 — API key invalid or expired

Invalid API key or the validity of your key over. Please contact support at

404 — page not found

It is impossible to get the result for specified request parameters. Check id_type parameter, which is mandatory for all entities, except for the actual type.

500 — server error

Temporary disruption of service.

501 — requested method does not exist

Requested a non-existent action for the specified entity.

503 — data updating

Temporary discontinuance of service because of database updates.

509 — API requests limit

Exceeded the maximum number of calls to the API in the last 24 hours. Wait please.

200 — successful request

Ready example of working with Car2DB API on PHP