Easy APIs Project

Available APIs

We are providing four APIs for now. Those are Meanings API, Eval API, UnitConversion API and Weather API. We hope to extend the count of API services provided.

Common Format

Easy APIs use curly brackets to provide services. A common web response might be something like

{one value here}{another value here}

Manipulate response

Easiest way to use Easy API responses is manipulate them and put each value in an array. For that a developer can use string.split() which is available in all languages.

Simple Steps

  1. Read the whole web response and get it in a string variable
  2. Depericate first { in response string
  3. Depericate last } in response string
  4. Split the response string with }{ and put into array
  5. traverse through the array to use every value

Sample C# Scenario

							namespace SampleStringManipulationInCSharp
							{
								class Program
								{
									static void Main(string[] args)
									{
										//STEP 1 - getting web response and put it to string
										string resp = "{pi}{3.14159265359}";
										
										//STEP 2 - eliminate first {
										resp = resp.Substring(1);
										
										//STEP 3 - eliminate last }
										resp = resp.Remove(resp.Length - 1);
										
										//STEP 4 - split with }{ and put to array
										string[] words = 
											resp.Split(new string[]{"}{"},StringSplitOptions.None);
											
										//STEP 5 - traverse througth array
										Console.Write("Value of PI is : "+words[1]);
										
										Console.ReadLine();
									}
								}
							}
							

Meanings API

Meanings API is giving meanings for a given word. Developers can access to it via http://gcdc2013-easyapisproject.appspot.com/meanings?q=[your_word_here]

Example URL : http://gcdc2013-easyapisproject.appspot.com/meanings?q=excitement

Response :
{the feeling of lively and cheerful joy}{the state of being emotionally aroused and worked up}{something that agitates and arouses}{disturbance usually in protest}{the state of being excited (emotionally aroused).}{something that excites.}

Eval API

Eval API evaluates an equation and gives the answer. Developers can access it via http://gcdc2013-easyapisproject.appspot.com/eval?q=[your_equation_here]

Example URL : http://gcdc2013-easyapisproject.appspot.com/eval?q=pi

Response :
{pi}{3.14159265359}

Notes :

  1. URLs can only be sent over the Internet using the ASCII character-set. Since URLs of equations often contain characters outside the ASCII set(eg: http://gcdc2013-easyapisproject.appspot.com/eval?q=1+5), the URL has to be converted into a valid ASCII format using URL Encoding.
  2. pi,e, ceil(x),copysign(x, y), etc.. functions are available. For the complete list refer here and use it without math. (math.factorial(x))
    (Eg : http://gcdc2013-easyapisproject.appspot.com/eval?q=factorial(10)
  3. 25 can be achieved with http://gcdc2013-easyapisproject.appspot.com/eval?q=2**5

UnitConversion API

UnitConversion API can be used to unit conversions (Eg : 10 degrees to radians). Developers can access it via http://gcdc2013-easyapisproject.appspot.com/unitconversion?q=[your_unit_conversion_query_here]

Example URL : http://gcdc2013-easyapisproject.appspot.com/unitconversion?q=10 degrees in radians

Response :
{10 degrees }{ 0.17453225356046 radians}

Notes :

  1. 10 degrees to radians as well as 10 degrees in radians will work. No other query format will work
  2. Common query format is [number][space][origin unit][space][to\in][space][destination unit]

Weather API

Weather API gives the current weather of a given city. Developers can access it via http://gcdc2013-easyapisproject.appspot.com/weather?q=[your_city_name]

Example URL : http://gcdc2013-easyapisproject.appspot.com/weather?q=Munich

Response :
{weather summery}{broken clouds}{temperature}{278.77 kelvin}{temperature min}{277.15 kelvin}{temperature max}{279.65 kelvin}{humidity}{86 %}{pressure}{996 hPa}{wind speed}{3.6 m/s}{wind direction degree}{50}{wind direction name}{NorthEast}{clouds}{broken clouds}

Notes :

  1. description of response : {weather summery}{simple summery of the weather}{temperature}{temperature of the city in kelvin}{temperature min}{minimum expected temp of the city in kelvin}{temperature max}{maximum expected temp of the city in kelvin}{humidity}{percentage of humidity}{pressure}{pressure in hPa}{wind speed}{wind speed in meter per second}{wind direction degree}{wind direction in degrees}{wind direction name}{name of the wind direction}{clouds}{type of clouds}