Car Registration #API now available as #Python #Package (#Egg)
CarRegistration
This is an API Wrapper for Python for the VehicleRegistrationApi.com API which allows you to get car data from it’s number plate in many countries across the globe, from the USA, Europe, Australia, and Africa.
An account username and password is required from VehicleRegistrationApi.com
When using the Generic “CarRegistration” function, the fourth parameter is an API endpoint, which can be one of;
- Check (UK)
- CheckBelgium
- CheckCroatia
- CheckCzechRepublic
- CheckDenmark
- CheckEstonia
- CheckFinland
- CheckFrance
- CheckHungary
- CheckIndia
- CheckIreland
- CheckItaly
- CheckNetherlands
- CheckNewZealand
- CheckNigeria
- CheckNorway
- CheckPortugal
- CheckRussia
- CheckSlovakia
- CheckSouthAfrica
- CheckSpain
- CheckSriLanka
- CheckSweden
- CheckUAE
For Australia and USA, you must also pass a state parameter, and therefore you must use the CarRegistrationUSA or CarRegistrationAustralia methods.
Installation
easy_install CarRegistration
Usage (UK)
from CarRegistration import *
CarRegistration("BL64JTZ","***YOUR USERNAME***","***YOUR PASSWORD***","Check")
Usage (France)
from CarRegistration import *
CarRegistration("Eg258ma","***YOUR USERNAME***","***YOUR PASSWORD***","CheckFrance")
Usage (USA)
from CarRegistration import *
CarRegistrationUSA("H84jae","nj","***YOUR USERNAME***","***YOUR PASSWORD***")
Usage (Australia)
from CarRegistration import *
CarRegistrationAustralia("YHC14Y","NSW","***YOUR USERNAME***","***YOUR PASSWORD***")
Sample output
{u'RegistrationYear': u'2015', u'CarModel': {u'CurrentTextValue': u'208'}, u'NumberOfDoors': {u'CurrentTextValue': u'3'}, u'EngineSize': {u'CurrentTextValue': u'1397
And here’s the source code for those interested:
import urllib2, base64, json
def CarRegistration(registrationNumber, username, password):
request = urllib2.Request(“http://www.regcheck.org.uk/api/json.aspx/Check/” + registrationNumber)
base64string = base64.encodestring(‘%s:%s’ % (username, password)).replace(‘\n’, ”)
request.add_header(“Authorization”, “Basic %s” % base64string)
result = urllib2.urlopen(request)
data = json.load(result)
return(data)
-
June 20, 2018 at 5:25 pmCar Registration #API available on #Python #PIP | Network Programming in .NET