Skip to main content

Unoffical Python API for CarJam NZ

Project description

CarJam is a resource for finding information about cars registered in NZ.

This unofficial python API allows you to interact with the site and retrieve data to use in other python projects.

This API may stop functioning if CarJam updates their website code. It is provided "as-is" with no implied warranty. No responsibility is assumed for any future issues or interruptions in API functionality as a result of using this library.

Find this library on PyPi here and Github here

Installation

pip install carjam

Basic car details

import carjam
client = carjam.Client()
details = client.basic_details('fkk351')

Returns an json object containing basic car details:

{
	"plate": "FKK351",
	"vin": "7AT0H63WX10005902",
	"chassis": "ACT10-0005902",
	"current_vehicle_odometer_unit": "K",
	"reported_stolen": "U",
	"make": "TOYOTA",
	"year_of_manufacture": 2000,
	"vehicle_type": 7,
	"usage_level": 1.91,
	"average_fleet_mileage": 10500
}

Car model details

import carjam
client = carjam.Client()
details = client.model_details('fkk351')

Returns a json object containing more specific model details:

{
	"car_id": 0,
	"chassis_number": "ACT10-0005902",
	"make": "TOYOTA",
	"model": "OPA",
	"grade": "I",
	"manufacture_date": "2000-09",
	"body": "TA-ACT10",
	"engine": "1AZFSE",
	"drive": "FF",
	"transmission": "CVT"
}

Car fuel consumption

import carjam
client = carjam.Client()
fuel_consumption = client.fuel_consumption("fkk351")

Returns a string containing the fuel consumption of the car in l/100km:

7.50 litres/100km

Car images

import carjam
client = carjam.Client()
image = client.image('fkk351')

Returns a json object containing links to the current and original image

{
	"image": "photos.carjam.co.nz/jph/_search_img_catalog_10102041_200404.jpg",
	"orig_image": "photos.carjam.co.nz/jph/_search_img_catalog_10102041_200404.jpg"
}

Car Odometer Details

import carjam
client = carjam.Client()
odo_details = client.odometer_history('fkk351')

Returns a json object array containing odometer history

[
  {
    "odometer_date": 1678618800,
    "odometer_reading": "296662",
    "odometer_unit": "K",
    "odometer_source": "IW",
    "days": 7,
    "seconds": 604800,
    "kms": 359,
    "daily_usage": 51.285714285714285
  },
  ...
]

NZ Fleet Details

import carjam
client = carjam.Client()
fleet_details = client.fleet_details(page=1)

Returns a JSON object containing the most registered cars in NZ, with 20 objects per call. You can change the page parameter to retrieve additional sets of data.

[
  {
    "make": "FORD",
    "model": "RANGER",
    "year": "2021",
    "count": "12463",
    "rank": "1"
  },
  ...
]

fleet_details() can also take optional filter variables:

import carjam
client = carjam.Client()
filtered_fleet_details = client.fleet_details(page=1, make='TOYOTA', query="cor", fuel_type="PETROL")

Returns a JSON object containing the most registered cars in NZ filtered by the params, with 20 objects per call. You can change the page parameter to retrieve additional sets of data.

[
  {
    "make": "TOYOTA",
    "model": "COROLLA",
    "year": "2004",
    "count": "8428",
    "rank": "17"
  },
  ...
]

Development and Contribution

I welcome any contributions to this project, so feel free!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carjam-1.0.2.post1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carjam-1.0.2.post1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file carjam-1.0.2.post1.tar.gz.

File metadata

  • Download URL: carjam-1.0.2.post1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for carjam-1.0.2.post1.tar.gz
Algorithm Hash digest
SHA256 bb48051dd0a568646b7581275b69658fe4a375cfb3a5e2ac97fdd040dc723541
MD5 11df4b4e8e473fb85f2905dca15f6bc2
BLAKE2b-256 a46e360cd0f16084bac5208e4908804baa79ab36e28e9103229175bef149f26a

See more details on using hashes here.

File details

Details for the file carjam-1.0.2.post1-py3-none-any.whl.

File metadata

  • Download URL: carjam-1.0.2.post1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for carjam-1.0.2.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 fa25e0dd93c5dab17edf410656a8bcc584b46919937670d5b84fbe09e4ad6276
MD5 7eb02e39783f9bfe784845041d6464e1
BLAKE2b-256 19d56b225dd3b2725fe3c6bf382a9f51d73d04efb0a4118bab09353fe1e5a8dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page