Archive

Archive for August, 2018

#API to get vehicle information from a car number plate in #Mexico

August 30, 2018 Leave a comment

Mexico-6

Mexico, a country with 43 million motor vehicles, is the latest south american country to be added to our growing coverage of vehicle number plate lookup APIs. This API allows you to input a car number plate in Mexico, and get the vehicle information in response.

Car registration plates in Mexico use the /CheckMexico endpoint and return the following information:

  • Make & Model
  • Age
  • Representative image
  • Engine
  • NCI
  • VIN number

Sample Registration Number:
JGS9180
Sample Json:

{
“Description”: “NISSAN SENTRA”,
“RegistrationYear”: “2007”,
“CarMake”: {
“CurrentTextValue”: “NISSAN”
},
“CarModel”: {
“CurrentTextValue”: “SENTRA”
},
“MakeDescription”: {
“CurrentTextValue”: “NISSAN”
},
“ModelDescription”: {
“CurrentTextValue”: “SENTRA”
},
“Class”: “AUTOMOVIL”,
“Type”: “SEDAN”,
“VIN”: “3N1AB61D17L630743”,
“NCI”: “0A3J8GO2”,
“Doors”: “4”,
“Country”: “MEXICO”,
“Version”: “CUSTOM 20 TM”,
“EngineSize”: “2.0L”,
“Cylinders”: “L4”,
“Axles”: “”,
“AssemblyPlant”: “AGUASCALIENTES, MEXICO”,
“Institution”: “”,
“RegistrationDate”: “03/07/2007”,
“IssueDate”: “20/01/2012”,
“LastUpdate”: “12/01/2017”,
“CertifiateOfRegistration”: “”,
“Observations”: “”,
“ImageUrl”: “http://mx.placaapi.com/image.aspx/@TklTU0FOIFNFTlRSQQ==”
}

Get a free account at http://mx.placaapi.com

 

Advertisements
Categories: Uncategorized

New #API to determine vehicle information from registration numbers in #Brazil

August 28, 2018 Leave a comment

brazil

With a driving population of over 90 million, brazil is the largest country in south america, and via www.placaapi.com you can now determine make, model, VIN, location and other technical information from a vehicle registered in Brazil via its number plate.

Car registration plates in Brazil use the /CheckBrazil endpoint and return the following information:

  • Make & Model
  • Age
  • Representative image
  • Colour
  • Fuel
  • Location
  • VIN number

Sample Registration Number:

KNX9595

Sample Json:

{
  "Description": "GM - CHEVROLET VECTRA GT 2.0 MPFI 8V FLEXPOWER MEC.",
  "RegistrationYear": "2011",
  "CarMake": {
    "CurrentTextValue": "CHEVROLET"
  },
  "CarModel": {
    "CurrentTextValue": "Vectra GT 2.0 MPFI 8V FlexPower Mec."
  },
  "MakeDescription": {
    "CurrentTextValue": "CHEVROLET"
  },
"ModelDescription": {
"CurrentTextValue": "Vectra GT 2.0 MPFI 8V FlexPower Mec."
},
"ImageUrl": "http://www.placaapi.com/image.aspx/@Q0hFVlJPTEVUIFZlY3RyYSBHVCAyLjAgTVBGSSA4ViBGbGV4UG93ZXIgTWVjLg==",
"Location": "SAO LUIS, MA",
"Vin": "9BGAJ48C0BB209328",
"Fuel": "ALCOOL / GASOLINA",
"Colour": "AZUL",
"Power": "140",
"EngineCC": "2000",
"Type": "PASSAGEIRO",
"Seats": "5",
"Axles": "{}",
"GrossWeight": "180",
"MaxTraction": "230"
}
Categories: Uncategorized

Use #Namecheap #API to configure your #DNS

August 23, 2018 Leave a comment

sSwMqqsH_400x400

If you have domains registered with Namecheap, and you’d like a programmatic way to update DNS setttings – i.e. you want to change the IP address of a domain automatically in the event of a server outage, here’s how their API works.

First, you have to active the API via the control panel as follows;

  1. Login to your Namecheap account.
  2. Go to the Profile > Tools menu.
  3. Scroll down to the Business & Dev Tools section.
  4. Click MANAGE, next to Namecheap API Access.
  5. Toggle ON/OFF, read the Terms of Service
  6. Enter your account password.

Then add IP addresses that you are going to use to access the API. i.e. your local IP, and server IP.

When you call the command namecheap.domains.dns.setHosts on the namecheap API, it overwrites all existing DNS records, so you need to first read all the DNS records on a domain, then set them all back again, plus your change. So first step is to read all DNS records.

So, create a class to hold a DNS record

class HostRecord
{
public string Name { get; set; }
public string Type { get; set; }
public string Value { get; set; }

public override string ToString()
{
return string.Format(“[{0}] {1} : {2}”, Name, Type, Value);
}
}

The ToString() is just for debug purposes

Another helper method we need is some code to get our current IP, which is required by the API

private static string GetIP()
{
var wc = new WebClient();
var strIP = wc.DownloadString(“http://icanhazip.com”).Trim();
return strIP;
}

To get DNS hosts for a Domain registered on Namecheap;

private static List<HostRecord> GetHostsFromDomain(string SLD, string TLD)
{
var strUrl = “https://api.namecheap.com/xml.response?&#8221;;
strUrl += “ApiUser=….”;
strUrl += “&ApiKey=…..”;
strUrl += “&UserName=…..”;
strUrl += “&Command=namecheap.domains.dns.getHosts”;
strUrl += “&ClientIp=” + GetIP();
strUrl += “&SLD=” + SLD;
strUrl += “&TLD=” + TLD;
var wc = new WebClient();
var strXml = wc.DownloadString(strUrl);
XmlDocument xdoc = new XmlDocument();
xdoc.LoadXml(strXml);
XmlNamespaceManager ns = new XmlNamespaceManager(xdoc.NameTable);
ns.AddNamespace(“xxx”, “http://api.namecheap.com/xml.response&#8221;);
var hosts = xdoc.SelectNodes(“//xxx:host”, ns);
var lHosts = new List<HostRecord>();
Console.WriteLine(“Previous DNS Records”);
foreach (XmlNode host in hosts)
{
var record = new HostRecord()
{
Name = host.Attributes[“Name”].Value,
Type = host.Attributes[“Type”].Value,
Value = host.Attributes[“Address”].Value
};
lHosts.Add(record);
Console.WriteLine(record);
}
return lHosts;
}

If your domain is “boo.com”, then SLD is “boo” and TLD is “com”.

Once you have the list of Hostrecords, you can add or modify this collection, and then update the hosts as follows;

public static string SetHostRecords(string SLD, string TLD, List<HostRecord> records)
{
var strUrl2 = “https://api.namecheap.com/xml.response&#8221;;
string strPostData = “ApiUser=….”;
strPostData += “&ApiKey=….”;
strPostData += “&UserName=….”;
strPostData += “&Command=namecheap.domains.dns.setHosts”;
strPostData += “&ClientIp=” + GetIP();
strPostData += “&SLD=” + SLD;
strPostData += “&TLD=” + TLD;
for (int i = 0; i< records.Count; i++)
{
strPostData += “&HostName” + (i+1) + “=” + records[i].Name;
strPostData += “&RecordType” + (i+1) + “=” + records[i].Type;
strPostData += “&Address” + (i+1) + “=” + records[i].Value;
strPostData += “&TTL” + (i+1) + “=60”;
}
var wc2 = new WebClient();
wc2.Headers[“Content-Type”] = “application/x-www-form-urlencoded”;
var strXml2 = wc2.UploadString(strUrl2,strPostData);
return strXml2;
}

If you want to create a console app for this, where you can pass in command line arguments, then here’s some sample code for this;

var strSLD = args[0];
var strTLD = args[1];
var strName = args[2];
var strAddress = args[3];
var hosts = GetHostsFromDomain(strSLD, strTLD);
if (hosts.Any(h => h.Name == strName))
{
Console.WriteLine(“Updating Record “+ strName);
hosts.First(h => h.Name == strName).Value = strAddress;
}
else
{
Console.WriteLine(“Adding Record ” + strName);
hosts.Add(new HostRecord() { Type = “A”, Name = strName, Value = strAddress });
}
var strResponse = SetHostRecords(strSLD, strTLD, hosts);
Console.WriteLine(strResponse);

This only updates A records, you could modify the code to also update MX records, if you need to change email providers.

 

 

Categories: Uncategorized

Backing up a #SQL server Database to Amazon #S3 the easy way…

August 19, 2018 Leave a comment

tntdrive

You may have all your code saved safely in Source control, but your data is not something that can easily be regenerated in the event of a hard drive failure, or simple fat fingered, update or delete statement without a where clause.

Backing up your databases to the same machine saves against typos, but it doesn’t save against a server outage, you really need to get your backups off the server. Amazon S3 is a good option, since it costs under 2p per GB (London datacenter)

S3 Standard Storage
First 50 TB / Month $0.024 per GB

Now, there are a million ways you could get your server backups to S3, you could use a batch file, a custom script, some c# … However, I tried our Tnt Drive, which maps a drive to your S3 bucket, and uploads your files asyncronously.

Then all you need to do, is to put your backup on the mapped drive (Z), with a script like

backup database db to disk = ‘Z:\db.bak’

Categories: Uncategorized

Deciding which languages to localise an app or website to.

August 18, 2018 Leave a comment

banner

In the past, selling your services internationally was a logistically difficult task, however, with many IT products, you could just as easily find customers in Azerbaijan as you would in the USA. However, nobody in their right mind would consider localising to Azerbaijani before English. But, is Japanese more important than Spanish? for example.

So, lets get some caveats out of the way. This article assumes there is zero logistical, legal or technical boundaries between selling your app or website in any country worldwide. An app that gambles with real money will require country-specific licenses. It also assumes that your App is not culturally biased, few people in Japan will be interested in a weather app for Sweden.

So, do you focus on the richest countries, and target your app at Luxembourg, or the most populous countries, and go for Nigeria?, neither is a good choice, since one is too small, and the other is too poor. So, by going by total GDP you get US, China, Japan, Germany – the full list is here: https://en.wikipedia.org/wiki/List_of_countries_by_GDP_(nominal)

Now, this does not take into account the idea that an App in Spanish not only is applicable to Spanish users, but is also usable by Mexicans, Argentinians, Colombians etc. So, to combine GDP by Language, you get the following:

Rank Language Percentage of world GDP
1 English 29.3%
2 Chinese 12.5%
3 Japanese 7%
4 Spanish 6.5%
5 German 5.5%
6 French 4.6%
7 Portuguese 3.3%
8 Italian 3.2%
9 Russian 2.6%
10 Arabic 2.5%
11 Hindi 2.3%
12 Korean 1.7%
13 Indonesian 1.4%
14 Dutch 1.3%
15 Bengali 1%
16 Turkish 0.9%
17 Thai 0.9%
18 Polish 0.9%
N/A Other 12.5%

This list was compiled by Unicode.org.

So, in short, English is the obvious first language – and if you’re reading this, then your app is probably already in English. Chinese and Japanese come second, but Spanish comes before German – Even though Germany has higher GDP than Spain.

The next issue, is that you may need to take into account disposable income when planning your expansion. You have to discount the part of the population who are living in poverty, and thus will not buy anything outside their immediate needs. In china, the rate of poverty (i.e. <$5.50 a day), is 31.5%, (https://en.wikipedia.org/wiki/List_of_countries_by_percentage_of_population_living_in_poverty), so its relative importance is 8.5% , still above Spanish.

Of course, if you’re reading this, and you’re a translator – please feel free to register on OutsourceTranslation.com

Categories: Uncategorized

Cloud Answering Machine App now available in Spanish, German, and French

August 16, 2018 Leave a comment

1024

Our Cloud Answering Machine App, version 1.5, available via the iOS App store is now available in Spanish, German and French. It will automatically detect your phone language, and will switch the user interface to your preferred language.  Version 1.6, which is currently in review, will add support for Japanese, Korean and Portuguese

It also supports 32 new counties for provisioning phone numbers – which are :

Georgia
Kenya
United Arab Emirates
Bolivia
Belarus
Colombia
Philippines
Thailand
Barbados
Benin
Grenada
Ghana
Guinea
Jamaica
Trinidad and Tobago
Tanzania
Uganda
Cayman Islands
Guatemala
Algeria
Namibia
Ecuador
Tunisia
Vietnam
Mali
Bosnia and Herzegovina
Mauritius
Botswana
Macau
Singapore
Serbia

The App is also available for android, windows phone, and the web at https://www.cloudansweringmachine.com/

Categories: Uncategorized

UK Car Valuation #API available for free

August 15, 2018 Leave a comment

your-car-valuation

We’re now offering our UK car valuation API for free, all you need is a valid account on our website. You can access this API via the following endpoint

https://www.regcheck.org.uk/api/bespokeapi.asmx?op=CheckPrice

Where you pass the vehicle reg number, mileage and your username, and it will return data in the format (Prices are in GBP);

<Description>
Peugeot 208 (2015-) 5Dr Hatchback 1.2 PureTech SS 110 EU6 GT Line EAT Auto6
</Description>
<Price>9240</Price>
</Valuation>
The mileage of any given car can be estimated from the latest MOT report, which can be accessed via the following url;
Categories: Uncategorized