Archive
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)
Our APIs are now on #RubyGems to help Ruby developers get started quickly

We’re now on RubyGems.org at https://rubygems.org/profiles/fiach – with a total of 25 Ruby Gems to be installed. They make using our Car Registration API’s Really easy to use for Ruby Developers
Just type:
gem install CarRegistrationUKirb
(Replacing “UK” with any other country we support)
Then, type;
require(“CarRegistrationUK”)
data = CarRegistrationUK.Lookup(“SL14MKM”,”**username**”,”**password**”)
- Obviously, you need to get your own username and password from RegCheck.org.uk – and SL14MKM is just a sample plate.
And get an object array back such as;
{“ABICode”=>”18503204”,
“Description”=>”2014 Ford Mondeo Titanium X Business Edit Tdci 140, 1997CC Diesel, 5DR, Manual”,
“RegistrationYear”=>”2014”,
“CarMake”=>{“CurrentTextValue”=>”Ford”},
“CarModel”=>{“CurrentTextValue”=>”Mondeo”},
“EngineSize”=>{“CurrentTextValue”=>”1997CC”},
“FuelType”=>{“CurrentTextValue”=>”Diesel”},
“MakeDescription”=>”Ford”,
“ModelDescription”=>”Mondeo”,
“Immobiliser”=>{“CurrentTextValue”=>””},
“NumberOfSeats”=>{“CurrentTextValue”=>5},
“IndicativeValue”=>{“CurrentTextValue”=>””},
“DriverSide”=>{“CurrentTextValue”=>”RHD”},
“Transmission”=>{“CurrentTextValue”=>”Manual”},
“NumberOfDoors”=>{“CurrentTextValue”=>”5”},
“ImageUrl”=>”http://www.regcheck.org.uk/image.aspx/@Rm9yZCBNb25kZW8=”,
“VehicleInsuranceGroup”=>”19”}
You can access any property of this like so
data[“Description”]
Giving –
“2014 Ford Mondeo Titanium X Business Edit Tdci 140, 1997CC Diesel, 5DR, Manual”
For those interested in looking under the hood, here is the source code of the Ruby Gem itself ;
require “open-uri”
require “json”class CarRegistrationLookupError < StandardError def initialize(msg=”Unknown error”) super end end class CarRegistrationUK def self.Lookup(registrationNumber,username,password) begin @data = open(“https://www.regcheck.org.uk/api/json.aspx/Check/” + registrationNumber,http_basic_authentication: [username, password]).read rescue OpenURI::HTTPError => error
raise CarRegistrationLookupError, error.io.string
end
return JSON.parse(@data)
end
end
#Nigerian Car Registration #API

Nigeria, home to 186 million people, and 10 million cars is the newest country to be added to our growing coverage of car registration APIs, and it’s accessible via http://ng.carregistrationapi.com/
It’s our third country in the Middle East / Africa continent to be added to our network, after UAE and South Africa, and we hope to add more in the coming months.
Prices start at 7 Naira per lookup, 0.02 USD – but we’re happy to offer introductory free credits for new companies for the next few months.
#AvatarAPI is now on #NPM for #NodeJS users

Let’s face it, not all your users bother with uploading a photo of themselves on your website, but it looks bland and boring when you just assign everyone with a placeholder image. AvatarAPI allows you get the real name and profile picture of your users from their email address. Great for giving that splash of colour and friendliness to your website.
We’ve just created an NPM package for the Avatar API so that NodeJS users can easily import the functionality into their apps.
Installation
Usage
We’re now on #NPM; making it easy to use our #APIs from #NodeJS

And here’s our first set of 20 Packages…
- car-registration-api-france – v1.0.6 – Get car information from a French number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-sweden – v1.0.5 – Get car information from a Swedish number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-spain – v1.0.5 – Get car information from a Spanish number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-slovakia – v1.0.5 – Get car information from a Slovakian number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-italy – v1.0.5 – Get car information from an Italian number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-russia – v1.0.5 – Get car information from a Russian number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-norway – v1.0.5 – Get car information from a Norwegian number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-portugal – v1.0.5 – Get car information from a Portuguese number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-pakistan – v1.0.6 – Get car information from a Pakistani number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-uk – v1.0.4 – Get car information from a UK number plate. An account username is required, which you can get from RegCheck.org.uk
- car-registration-api-czechrepublic – v1.0.4 – Get car information from a Czech number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-newzealand – v1.0.5 – Get car information from a New Zealand number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-uae – v1.0.5 – Get car information from a United Arab Emirates number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-finland – v1.0.4 – Get car information from a Finnish number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-southafrica – v1.0.5 – Get car information from a South African number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-netherlands – v1.0.5 – Get car information from a Dutch number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-estonia – v1.0.4 – Get car information from an Estonian number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-india – v1.0.5 – Get car information from a Indian number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-ireland – v1.0.5 – Get car information from an Irish number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-srilanka – v1.0.5 – Get car information from a Sri Lankan number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-croatia – v1.0.5 – Get car information from a Croatian number plate. An account username is required, which you can get from http://www.provjeraregistracije.com
- car-registration-api-denmark – v1.0.5 – Get car information from a Danish plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-usa – v1.0.5 – Get car information from an American number plate. An account username is required, which you can get from http://www.vehicleregistrationapi.com
- car-registration-api-australia – v1.0.5 – Get car information from an Australian number plate. An account username is required, which you can get from http://www.carregistrationapi.com
Get a country code from an address in c#

If you have a partial address, or just a town / city name and you’d like to get the country code (ISO3166) then you can use Google’s geocode API from c# as follows;
The Google API key is not strictly necessary, but it’s recommended, as they will probably throttle use for unauthenticated calls.
public static string GetCountryFromAddress(string address)
{try
{
// API key is recommended, but not required
const string strGoogleApiKey = “….”;
var strUrl = “https://maps.googleapis.com/maps/api/geocode/json?address={0}&key={1}”;
strUrl = string.Format(strUrl, address, strGoogleApiKey);
var wc = new WebClient();
var strJson = wc.DownloadString(strUrl);
var json = JObject.Parse(strJson);
var jResult = json[“results”][0];
var jAddressComponents = jResult[“address_components”];
foreach (var jAddressComponent in jAddressComponents)
{
var jTypes = jAddressComponent[“types”];
if (jTypes.Any(t => t.ToString() == “country”))
{
return jAddressComponent[“short_name”].ToString();
}
}
return null;
}
catch
{
return null;
}
}
#Headless CMS using C#, #NodeJS or #Java

Headless Content Management – (https://www.headlesscontentmanagement.com/) is a service that decouples the work typically done by content writers and developers. It is designed for use in situations where the content is not going to be viewed on a web-page, but instead is going to be displayed within a mobile app or desktop application.
There are many CMS systems out there, and most of them have APIs. Your content team are probably familiar with the likes of WordPress, Joomla and Dotnetnuke – but most operate on the premise that the content is going to be viewed on a web page via a web browser. Headless Content Management makes no such assumption, and won’t help you display your content online – it just exposes the content via a set of APIs, XML and JSON based.
Headless CMS can also be used in situations where you have an existing website that isn’t based on a CMS platform like WordPress / Joomla etc. So if you have a in-house developed bespoke website, and need to make it easy for content writers to add and edit content on your website. You can use Headless Content Management to manage your content, then have your existing website call our APIs, in order to retrieve the content to be displayed.
The interface with HeadlessContentManagement.com can be done via many different languages, here are three popular examples – C#, NodeJS and Java
C#
// You need to make a service reference to https://HeadlessContentManagement.com/api.asmx
var api = new api.APISoapClient();// Replace the username and password with those defined on HeadlessContentManagement.com
var strUsername = “demouser@webtropy.com”;
var strPassword = “demo”;Console.WriteLine(“Select one of the following articles by it’s id number”);
var articles = api.ListArticles(strUsername, strPassword);
foreach(var article in articles)
{
Console.WriteLine(string.Format(“{0}. {1}”, article.id, article.subject));
}
// Ask the user to enter a number
var strId = Console.ReadLine();
var intArticleId = Convert.ToInt32(strId);// Get that one Article
var selectedArticle = api.ReadArticle(strUsername, strPassword, intArticleId);
Console.WriteLine(selectedArticle.body);
Console.ReadLine();

NodeJS
var request = require(‘request’); // run npm install request
var email = ‘demouser@webtropy.com’;
var password = ‘demo’;
request.post(
‘https://www.headlesscontentmanagement.com/ajax/ListArticles.aspx’,
{form:{email:email,password:password}},
function (error, response, body) {
if (!error && response.statusCode == 200) {
showArticleSummary(JSON.parse(body));
}
else
{
console.log(response.statusCode);
console.log(body);
}
}
);function showArticleSummary(Articles)
{
console.log(“Please Select one of the following article ids”);
for(var i in Articles)
{
var Article = Articles[i];
console.log(Article.id + “. ” + Article.subject);
}
process.stdout.write(“>”)
var stdin = process.openStdin();stdin.addListener(“data”, function(d) {
var strArticleId = d.toString().trim();
var intArticleId = parseInt(strArticleId);
process.stdin.pause();
ReadArticle(intArticleId);
});
}function ReadArticle(intArticleId)
{
request.post(
‘https://www.headlesscontentmanagement.com/ajax/ReadArticle.aspx’,
{form:{email:email,password:password, id:intArticleId}},
function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(JSON.parse(body).body);
}
else
{
console.log(response.statusCode);
console.log(body);
}
}
);
}

Java
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.MalformedURLException;
import java.io.IOException;
import java.io.*;
import org.json.JSONException; // requires org.json package from https://mvnrepository.com/artifact/org.json/json/20170516
import org.json.JSONObject;
import org.json.JSONArray;public class HeadlessContentManagement {
public static void main(String[] args) {
String strJson = getJson(“https://www.headlesscontentmanagement.com/ajax/ListArticles.aspx”, “email=demouser@webtropy.com&password=demo”);
System.out.println(“Got Response”);
JSONArray array = new JSONArray(strJson);
for(int i = 0 ; i < array.length() ; i++){
JSONObject article = array.getJSONObject(i);
System.out.println(article.getInt(“id”) + “. ” + article.getString(“subject”));
}
}
public static String getJson(String serverUrl,String param){
StringBuilder sb = new StringBuilder();
String http = serverUrl;
HttpURLConnection urlConnection = null;
try {
URL url = new URL(http);
urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setRequestMethod(“POST”);
urlConnection.setUseCaches(false);
urlConnection.setConnectTimeout(50000);
urlConnection.setReadTimeout(50000);
urlConnection.connect();
OutputStreamWriter out = new OutputStreamWriter(urlConnection.getOutputStream());
out.write(param);
out.close();
int HttpResult = urlConnection.getResponseCode();
if (HttpResult == HttpURLConnection.HTTP_OK) {
BufferedReader br = new BufferedReader(new InputStreamReader(
urlConnection.getInputStream(), “utf-8”));
String line = null;
while ((line = br.readLine()) != null) {
sb.append(line + “\n”);
}
br.close();
return sb.toString();
} else {
System.out.println( urlConnection.getResponseMessage());
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (urlConnection != null)
urlConnection.disconnect();
}
return null;
}
}
You’re linking to your #socialmedia wrong! @urlgenius

Most people when using a mobile device, when they click on your instagram, facebook or twitter link, they would prefer to see that page in the respective app rather than the website version of that page.
UrlGenius is a tool that detects the user agent of the visitor, be it Android, iOS, or desktop, and redirects the user to the correct app (- if mobile), or the webpage, if desktop.
For example https://urlgeni.us/instagram/codgf will redirect to
instagram://user?username=cityofderryguitarfestival
(on iOS)
or
(on Android)
Plus it gives you all the visitor stats you need, like a bit.ly link.