Google APIs By Mohammed Farrag Shibin Al-Kawm GTUG Admin
What is API ?! About Google API. Start Using Google API. Google API in different languages. Manage your business using Google API. How Google builds API ?! Future of Google API. Google API Code Explorer. Google API Periodic Table. Google Competitions. Be Googler !! Overview
Allows search over Google’s entire index of billions of web pages. Enabling developers to give customers more information with the interactivity consumers and business users expect. Uses SOAP - Simple Object Access Protocol – used for information exchange (esp. http). Google APIs
• But: – Limit of 1,000 queries per day (without special arrangement). – Limit of 10 results per query (top 10) • Can be overcome somewhat through query refinement).
• Register http://code.google.com/intl/ar/apis/base/signup.html • Agree to terms and conditions • Get key – A 32 byte code – Needed for each query submission – E-mailed to you • Download API Getting Started
Google Java API • API for Java is an executable jar • Set appropriate classpath • Some sample code: import com.google.soap.search.*; … GoogleSearchgoogs = new GoogleSearch(); googs.setKey(myGoogleKey); googs.setQueryString(“TREC 2005 papers"); GoogleSearchResultgoogResults = googs.doSearch(); GoogleSearchResultelementr.getResultElements(); max = googResults.getEstimatedTotalResultsCount(); GoogleSearchResultElementmyresults = googResults.getResultElements(); String a_URL = (String) myresults.getURL(); Google Java API
So How do I Query Google? #!/usr/local/bin/perl –w use SOAP::Lite; # Configuration $key = "Your Key Goes Here"; # Initialize with local SOAP::Lite file $service = SOAP::Lite -> service('file:GoogleSearch.wsdl'); $query= “duluth”;
Limit is 1,000 queries – Catch GoogleSearchFault, or, – Local counter to track – In any case, put thread to sleep for 24 hrs. • Google server may get overloaded – In error processing, capture “Please try again in 30 seconds” – Put in 30 second sleep, and retry query Programming Notes
getEstimatedTotalResultsCount max = googResults.getestimatedTotalresultsCount(); – max could be more than 10 – max is an estimate; could be wrong • Search only over main index (no GoogleScholar, Froogle, etc..).
A Year In Maps API Time Wikipedia and Panoramio API Layers Find IP-based location through API Maps API for Flash AIR Support 17 new areas covered by StreetView API Monetize your mashup with Googlebar (Local Search) Mashups work in iPhone browser Earth API Launches Walking Directions Added to API February March April May May June July August September October November December January Enable API sites to easily replicate maps.google.com Reverse Geocoding API Launched SSL support in Maps API Premier Maps API for Flash Launches MapMaker tiles in API Maps API exits beta Static Maps API Support Satellite Tiles MarkerClusterer Launches 16
A Year in Maps API Time: More Security Location August 2008: Launched SSL for Maps API Premier <Insert great example of totally secure site here that wants us to broadcast their site to everyone> 17
A Year in Maps API Time: More Layers September 2008: Launched GLayer for Wikipedia and Panoramio 18
19 A Year In Maps API Time: More Imagery/Data September 2008: Static Maps API Supports Satellite, Hybrid, and Terrain AND Geoeye-1 Launches
A Year in Maps API Time: More Geocoding October 2008: Launched reverse geocoding in the API 20
A Year in Maps API Time: More Flash November 2008: Launched AIR Support in Maps API for Flash 21
A Year in Maps API Time: More Data (MapMaker) December 2008: Launched MapMaker tiles in the API Lahore, Pakistan in Google Maps(circa Where 2.0 2008) Lahore, Pakistan in Google Maps(circa Where 2.0 2009) 22
A Year in Maps API Time: More Platforms January 2009: Existing mashups work in iPhone browser
1. Search panel - Use this to find places and directions and manage search results. Google Earth EC may display additional tabs here. 2. Overview map - Use this for an additional perspective of the Earth. 3. Hide/Show sidebar - Click this to conceal or the display the side bar (Search, Places and Layers panels). 4. Placemark - Click this to add a placemark for a location. 5. Polygon - Click this to add a polygon. 6. Path - Click this to add a path (line or lines). 7. Image Overlay - Click this to add an image overlay on the Earth.
8. Measure - Click this to measure a distance or area size. 9. Email - Click this to email a view or image. 10. Print - Click this to print the current view of the Earth. 11. Show in Google Maps - Click this to show the current view in Google Maps in your web browser 12. Navigation controls - Use these to tilt, zoom and move around your viewpoint (see below). 13. Layers panel - Use this to display points of interest. 14. Places panel - Use this to locate, save, organize and revisit placemarks.
15. 3D Viewer - View the globe and its terrain in this window. 16. Status bar - View coordinate, elevation and imagery streaming status here.
View an image of your home, school or any place on Earth - Click Fly To. Enter the location in the Go on a tour of the world Get driving directions from one place to another and fly (follow) the route - See Getting Directions View other cool locations and features created by other Google Earth users - In the Layers panel. Go Through Streets, See live show. What I can do with Google Earth ?!
AdWords API AdSense API Google Checkout Fast, secure checkout across the Web YouTube API Google Translate API And many more !! Other Google APIs
Users can write programs and applications to perform functions in each of these five areas: Account management – change user preferences such as email address, password and more at the account level. Campaign management – manage bids, update creative and other campaign operations Reporting – generate reports to integrate directly into local databases Traffic estimation – receive traffic estimates for individual keywords Keyword generation – generate keywords from a base keyword or a web page AdWords API
REST == Representational State Transfer Client and servers transferring resource representations Good for cached and layered systems (like the web) In HTTP, this means verbs acting on resource URIs GET http://gdata.youtube.com/feeds/api/channels How Google Builds API ?!
WSDL Web Services Description Language The standard format for describing a web service. Expressed in XML, a WSDL definition describes how to access a web service and what operations it will perform. This is the most important file (only) to use the API with Perl.
SOAP – Simple Object Access Protocol SOAP stands for Simple Object Access Protocol SOAP is a communication protocol SOAP is for communication between applications SOAP is a format for sending messages SOAP is designed to communicate via Internet SOAP is platform independent SOAP is based on XML SOAP will be developed as a W3C standard
Now.. Google may earn more money from me -except Google business APIs- What About earning money from Google ?! Google offers many competition for developers to earn money. Google supports Open Source Project Development.
1. Google Code Jam 2. Google Summer of Code. 3. Google Internships. Google Competitions
Be closer to Google more than ever !! Google Technology User Groups. http://wiki.gtugs.org/so-you-want-to-start-a-gtug Google Ambassador Contact Googlers through the conferences (e.g. G-Egypt)