SlideShare a Scribd company logo
Google API



Karola Weischenberg, André Küpper, Marco Vreydal, Russel Fossi
                                                             The slides are licensed under a
                                                  Creative Commons Attribution 3.0 License

      14.12.2010        Web Technologies
Overview
●   What's an API?
●   Google APIs
     ●   List of all APIs
     ●   Google Custom Search API
     ●   YouTube API
     ●   Google Maps API
●   Example Google Maps API
     ●   Adding map
     ●   Adding mouse event listener
     ●   Adding User Input to Map
●   MashUp (Live Coding)

2                           Web Technologies
What's an API?



                                Offers methods


            ApplicationProgrammingInterface
Uses methods without
knowing the code




3                Web Technologies
What's an API?
    Application Programming Interface
    Pros:
●   Easy to use, if API is well documented
●   Not everybody has to programm eyerything
    (reinvent the wheel)
●   Mashups are easier to create
    Cons:
●   You don´t know exactly how it works
●   It´s Google!
                                         http://trendsupdates.com/good-ridance-arthur-levinson/



4                     Web Technologies
Overview
●   What's an API?
●   Google APIs
     ●   List of all APIs
     ●   Google Custom Search API
     ●   YouTube API
     ●   Google Maps API
●   Example Google Maps API
     ●   Adding map
     ●   Adding mouse event listener
     ●   Adding User Input to Map
●   MashUp (Live Coding)

5                           Web Technologies
Google API

●   there is not only one „Google API“
●   Google provides many different APIs




                                          http://www.globecartoon.com

6                    Web Technologies
List of all APIs




7             Web Technologies
Google API


    Short introduction of three main APIs:
    ●   Google Custom Search Engine
    ●   YouTube
    ●   Google Maps




                                         http://www.techforceindia.co.uk/How_we_Work.htm


8                     Web Technologies
Overview
●   What's an API?
●   Google APIs
     ●   List of all APIs
     ●   Google Custom Search API
     ●   YouTube API
     ●   Google Maps API
●   Example Google Maps API
     ●   Adding map
     ●   Adding mouse event listener
     ●   Adding User Input to Map
●   MashUp (Live Coding)

9                           Web Technologies
Google Custom Search APIs
Google Search Engine – The heart of Google

 ●    Possibility for using the search engine of Google

 ●    Search over a single website or a collection of websites

 ●    Create a search engine tailored to your needs and interests.

 ●    Present results in your website

 ●    Prioritize or restrict search results based on websites you
      specify.


 10                     Web Technologies
Google Custom Search APIs
Google Search Engine – The heart of Google

 ●    Possibility for using the search engine of Google

 ●    Search over a single website or a collection of websites

 ●    Create a search engine tailored to your needs and interests.

 ●    Present results in your website

 ●    Prioritize or restrict search results based on websites you
      specify.


 11                     Web Technologies
Google Custom Search APIs
Very easy to use:

●    Sign in to Google account
●    Choose your settings
●    Get generated code
●    Embed code to your website




12                    Web Technologies
Google Custom Search APIs

google.setOnLoadCallback(function() {

var customSearchControl =
               new google.search.SearchControl(ID)
customSearchControl.setResultSetSize(switchTo);
var options = new google.search.DrawOptions();
options.setSearchFormRoot('cse-search-form');
customSearchControl.draw('cse', options);

 }, true);


 <div id="cse" style="width:100%;"></div>

 13               Web Technologies
Overview
●    What's an API?
●    Google APIs
     ●   List of all APIs
     ●   Google Custom Search API
     ●   YouTube API
     ●   Google Maps API
●    Example Google Maps API
     ●   Adding map
     ●   Adding mouse event listener
     ●   Adding User Input to Map
●    MashUp (Live Coding)

14                          Web Technologies
YouTube API
YouTube – Famous Video Platform
●    YouTube APIs and tools enables people to integrate YouTube
     videos content and functionality into websites, software
     applications or other devices.
●    Three types of functionality: Basic, medium an advanced
     ●   Custom Player and Widgets             Using only HTML
     ●   Player APIs and embedded Player
     ●   DATA API and chromeless player              JavaScript
                                                     ActionScript



                                           Java, .net, PHP, Python

15                    Web Technologies
YouTube API

●    More flexible than regular embedded players
      ●   add videos favourites, or play list
      ●   Choose from different layouts and Schemes


●    Any change updated automatically
      ●   colour change


●    The API enable your application to search for YouTube
      content(demonstrate it in the mash up)




16                          Web Technologies
Overview
●    What's an API?
●    Google APIs
     ●   List of all APIs
     ●   Google Custom Search API
     ●   YouTube API
     ●   Google Maps API
●    Example Google Maps API
     ●   Adding map
     ●   Adding mouse event listener
     ●   Adding User Input to Map
●    MashUp (Live Coding)

17                          Web Technologies
Google Maps APIs


                  Static Maps API:
               only creating an URL
                  and embedding
             this URL in an <img> tag




18         Web Technologies
Google Maps APIs


                 Web Services:
             using URL-request and
             manipulate the reuslts in
                 JSON or XML




19         Web Technologies
Google Maps APIs


                Maps API for flash:
                 embed Maps in
                flash applications




20         Web Technologies
Google Maps APIs


              Maps API JavaScript:
                we use this one
               on our web project




21         Web Technologies
Google Maps APIs


                 Google Earth API:
               needs Google Earth
              Plug-in for the browser
                and uses JavaScript




22         Web Technologies
Overview
●    What's an API?
●    Google APIs
     ●   List of all APIs
     ●   Google Custom Search API
     ●   YouTube API
     ●   Google Maps API
●    Example Google Maps API
     ●   Adding map
     ●   Adding mouse event listener
     ●   Adding User Input to Map
●    MashUp (Live Coding)

23                          Web Technologies
Example: Google Maps API




     Fits perfect in our project
     ●   Travel Together
          –   Users can offer tours
          –   Users can choose the best one
          –   Users can comment tours
     ●   In context: Generate Map with information about the
         offered tours


24                         Web Technologies
Connection and adding Map

<meta name="viewport" content="initial-scale=1.0,
   user-scalable=no"
/>
<script type="text/JavaScript" src=
   "http://maps.google.com/maps/api/js?sensor=false">
</script>




 25               Web Technologies
Connection and adding Map
<script type="text/JavaScript">
   var map;
   function initialize() {
     var latlng =
       new google.maps.LatLng(-34.397, 150.644);
     var myOptions = {
       zoom: 8,
       center: latlng,
       mapTypeId: google.maps.MapTypeId.ROADMAP
     }
     map = new google.maps.Map(document.getElementById
       ("map_canvas"), myOptions);
   }
</script>
<body onload="initialize()">
  <div id="map_canvas" style="width:1000px;
       height:500px"></div>
</body>


26                Web Technologies
Adding Mouse Event Listeners
var map;
   var marker;
   function initialize() {
     var latlng =
      new google.maps.LatLng(-34.397, 150.644);
     var myOptions = {
       zoom: 8,
       center: latlng,
       mapTypeId: google.maps.MapTypeId.ROADMAP
     }
     map = new google.maps.Map(document.getElementById
      ("map_canvas"), myOptions);

         google.maps.event.addListener(map, 'click',
             function(event) {
             placeMarker(event.latLng);
         });
     }


27                   Web Technologies
Adding Mouse Event Listener
     function placeMarker(location) {
          marker = new google.maps.Marker({
              position: location,
              map: map
          });
          map.setCenter(location);
     }




28             Web Technologies
Adding Information of tours
function attachMessage(marker) {
     var message = document.getElementById("description").value;
     var infowindow = new google.maps.InfoWindow(
         { content: message,
           size: new google.maps.Size(50,50)
         });
     google.maps.event.addListener(marker, 'click', function() {
       infowindow.open(map,marker);
     });
   }




<body onload="initialize()">
  <div id="map_canvas" style="width:1000px; height:500px"></div>
  <input type="text" name="description" value=""
          id="description" size="20">
</body>



 29                  Web Technologies
Overview
●    What's an API?
●    Google APIs
     ●   List of all APIs
     ●   Google Custom Search API
     ●   YouTube API
     ●   Google Maps API
●    Example Google Maps API
     ●   Adding map
     ●   Adding mouse event listener
     ●   Adding User Input to Map
●    MashUp (Live Coding)

30                          Web Technologies
Mashup

                                           User Input (e.g a click)


                       Google Maps API

Maps API output = YouTube API input



                          YouTube API



               Google Maps Video Finder
31                      Web Technologies
Any other places you want to travel to?

         Thank you, for your attention.




32              Web Technologies

More Related Content

PDF
Introduction to Cloud Computing with Google Cloud
PDF
Exploring Google APIs with Python
PDF
Introduction to serverless computing on Google Cloud
PDF
Easy path to machine learning (Spring 2020)
PPTX
Изборите за МРО гр София 14 януари
PPTX
Linked in BNI Avenyn 18 jan 2013
PPSX
Presentation1
PPT
МОСГБ
Introduction to Cloud Computing with Google Cloud
Exploring Google APIs with Python
Introduction to serverless computing on Google Cloud
Easy path to machine learning (Spring 2020)
Изборите за МРО гр София 14 януари
Linked in BNI Avenyn 18 jan 2013
Presentation1
МОСГБ

Viewers also liked (12)

PPTX
Twitter skola för BNI Avenyn 28 september 2012
PPT
S Strategy Eecondlife 2011
PPTX
Kort om Facebook för BNI Avenyn
PPSX
Photo Album
PDF
Nibiru final update
PPTX
PPTX
Pengenalan dan penggunaan peralatan gatek
DOCX
Modul praktikum instruksi dasar
PPTX
Pengenalan bentuk dan fungsi garis gambar
Twitter skola för BNI Avenyn 28 september 2012
S Strategy Eecondlife 2011
Kort om Facebook för BNI Avenyn
Photo Album
Nibiru final update
Pengenalan dan penggunaan peralatan gatek
Modul praktikum instruksi dasar
Pengenalan bentuk dan fungsi garis gambar
Ad

Similar to Google API (20)

PPTX
Introduction to Google APIs
PPTX
Google World - Hassan magdy
PPT
Gmaps001
PPTX
Intro to Web Map APIs
PDF
Better Genealogy Through APIs
PPTX
Google Map Code
PPT
Google Geo APIs Overview
PDF
Using the Google AJAX APIs
PPT
Programming With Amazon, Google, And E Bay
PPTX
PDF
The Developer Experience
PPTX
Trends in Web APIs Layer 7 API Management Workshop London
PDF
South America 2008: Open Social For Brand Advertising and Media
PDF
Web Based APIs
KEY
Rise of Mobile and Web Runtimes - for Standards-Next
PDF
Google APIs for NSBM Students
PPT
Mashups & APIs
PPT
An Overview of Web GIS and Location Based Services
KEY
Google, Developer Experience and Discovery
KEY
Guardian devexp and_discovery
Introduction to Google APIs
Google World - Hassan magdy
Gmaps001
Intro to Web Map APIs
Better Genealogy Through APIs
Google Map Code
Google Geo APIs Overview
Using the Google AJAX APIs
Programming With Amazon, Google, And E Bay
The Developer Experience
Trends in Web APIs Layer 7 API Management Workshop London
South America 2008: Open Social For Brand Advertising and Media
Web Based APIs
Rise of Mobile and Web Runtimes - for Standards-Next
Google APIs for NSBM Students
Mashups & APIs
An Overview of Web GIS and Location Based Services
Google, Developer Experience and Discovery
Guardian devexp and_discovery
Ad

Recently uploaded (20)

PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
project resource management chapter-09.pdf
PDF
Architecture types and enterprise applications.pdf
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
STKI Israel Market Study 2025 version august
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
Chapter 5: Probability Theory and Statistics
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Developing a website for English-speaking practice to English as a foreign la...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
August Patch Tuesday
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
The various Industrial Revolutions .pptx
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
Modernising the Digital Integration Hub
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
O2C Customer Invoices to Receipt V15A.pptx
observCloud-Native Containerability and monitoring.pptx
project resource management chapter-09.pdf
Architecture types and enterprise applications.pdf
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
STKI Israel Market Study 2025 version august
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Chapter 5: Probability Theory and Statistics
Module 1.ppt Iot fundamentals and Architecture
Developing a website for English-speaking practice to English as a foreign la...
Programs and apps: productivity, graphics, security and other tools
August Patch Tuesday
Hindi spoken digit analysis for native and non-native speakers
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
The various Industrial Revolutions .pptx
A contest of sentiment analysis: k-nearest neighbor versus neural network
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Modernising the Digital Integration Hub
1 - Historical Antecedents, Social Consideration.pdf
O2C Customer Invoices to Receipt V15A.pptx

Google API

  • 1. Google API Karola Weischenberg, André Küpper, Marco Vreydal, Russel Fossi The slides are licensed under a Creative Commons Attribution 3.0 License 14.12.2010 Web Technologies
  • 2. Overview ● What's an API? ● Google APIs ● List of all APIs ● Google Custom Search API ● YouTube API ● Google Maps API ● Example Google Maps API ● Adding map ● Adding mouse event listener ● Adding User Input to Map ● MashUp (Live Coding) 2 Web Technologies
  • 3. What's an API? Offers methods ApplicationProgrammingInterface Uses methods without knowing the code 3 Web Technologies
  • 4. What's an API? Application Programming Interface Pros: ● Easy to use, if API is well documented ● Not everybody has to programm eyerything (reinvent the wheel) ● Mashups are easier to create Cons: ● You don´t know exactly how it works ● It´s Google! http://trendsupdates.com/good-ridance-arthur-levinson/ 4 Web Technologies
  • 5. Overview ● What's an API? ● Google APIs ● List of all APIs ● Google Custom Search API ● YouTube API ● Google Maps API ● Example Google Maps API ● Adding map ● Adding mouse event listener ● Adding User Input to Map ● MashUp (Live Coding) 5 Web Technologies
  • 6. Google API ● there is not only one „Google API“ ● Google provides many different APIs http://www.globecartoon.com 6 Web Technologies
  • 7. List of all APIs 7 Web Technologies
  • 8. Google API Short introduction of three main APIs: ● Google Custom Search Engine ● YouTube ● Google Maps http://www.techforceindia.co.uk/How_we_Work.htm 8 Web Technologies
  • 9. Overview ● What's an API? ● Google APIs ● List of all APIs ● Google Custom Search API ● YouTube API ● Google Maps API ● Example Google Maps API ● Adding map ● Adding mouse event listener ● Adding User Input to Map ● MashUp (Live Coding) 9 Web Technologies
  • 10. Google Custom Search APIs Google Search Engine – The heart of Google ● Possibility for using the search engine of Google ● Search over a single website or a collection of websites ● Create a search engine tailored to your needs and interests. ● Present results in your website ● Prioritize or restrict search results based on websites you specify. 10 Web Technologies
  • 11. Google Custom Search APIs Google Search Engine – The heart of Google ● Possibility for using the search engine of Google ● Search over a single website or a collection of websites ● Create a search engine tailored to your needs and interests. ● Present results in your website ● Prioritize or restrict search results based on websites you specify. 11 Web Technologies
  • 12. Google Custom Search APIs Very easy to use: ● Sign in to Google account ● Choose your settings ● Get generated code ● Embed code to your website 12 Web Technologies
  • 13. Google Custom Search APIs google.setOnLoadCallback(function() { var customSearchControl = new google.search.SearchControl(ID) customSearchControl.setResultSetSize(switchTo); var options = new google.search.DrawOptions(); options.setSearchFormRoot('cse-search-form'); customSearchControl.draw('cse', options); }, true); <div id="cse" style="width:100%;"></div> 13 Web Technologies
  • 14. Overview ● What's an API? ● Google APIs ● List of all APIs ● Google Custom Search API ● YouTube API ● Google Maps API ● Example Google Maps API ● Adding map ● Adding mouse event listener ● Adding User Input to Map ● MashUp (Live Coding) 14 Web Technologies
  • 15. YouTube API YouTube – Famous Video Platform ● YouTube APIs and tools enables people to integrate YouTube videos content and functionality into websites, software applications or other devices. ● Three types of functionality: Basic, medium an advanced ● Custom Player and Widgets Using only HTML ● Player APIs and embedded Player ● DATA API and chromeless player JavaScript ActionScript Java, .net, PHP, Python 15 Web Technologies
  • 16. YouTube API ● More flexible than regular embedded players ● add videos favourites, or play list ● Choose from different layouts and Schemes ● Any change updated automatically ● colour change ● The API enable your application to search for YouTube content(demonstrate it in the mash up) 16 Web Technologies
  • 17. Overview ● What's an API? ● Google APIs ● List of all APIs ● Google Custom Search API ● YouTube API ● Google Maps API ● Example Google Maps API ● Adding map ● Adding mouse event listener ● Adding User Input to Map ● MashUp (Live Coding) 17 Web Technologies
  • 18. Google Maps APIs Static Maps API: only creating an URL and embedding this URL in an <img> tag 18 Web Technologies
  • 19. Google Maps APIs Web Services: using URL-request and manipulate the reuslts in JSON or XML 19 Web Technologies
  • 20. Google Maps APIs Maps API for flash: embed Maps in flash applications 20 Web Technologies
  • 21. Google Maps APIs Maps API JavaScript: we use this one on our web project 21 Web Technologies
  • 22. Google Maps APIs Google Earth API: needs Google Earth Plug-in for the browser and uses JavaScript 22 Web Technologies
  • 23. Overview ● What's an API? ● Google APIs ● List of all APIs ● Google Custom Search API ● YouTube API ● Google Maps API ● Example Google Maps API ● Adding map ● Adding mouse event listener ● Adding User Input to Map ● MashUp (Live Coding) 23 Web Technologies
  • 24. Example: Google Maps API Fits perfect in our project ● Travel Together – Users can offer tours – Users can choose the best one – Users can comment tours ● In context: Generate Map with information about the offered tours 24 Web Technologies
  • 25. Connection and adding Map <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/JavaScript" src= "http://maps.google.com/maps/api/js?sensor=false"> </script> 25 Web Technologies
  • 26. Connection and adding Map <script type="text/JavaScript"> var map; function initialize() { var latlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 8, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById ("map_canvas"), myOptions); } </script> <body onload="initialize()"> <div id="map_canvas" style="width:1000px; height:500px"></div> </body> 26 Web Technologies
  • 27. Adding Mouse Event Listeners var map; var marker; function initialize() { var latlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 8, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById ("map_canvas"), myOptions); google.maps.event.addListener(map, 'click', function(event) { placeMarker(event.latLng); }); } 27 Web Technologies
  • 28. Adding Mouse Event Listener function placeMarker(location) { marker = new google.maps.Marker({ position: location, map: map }); map.setCenter(location); } 28 Web Technologies
  • 29. Adding Information of tours function attachMessage(marker) { var message = document.getElementById("description").value; var infowindow = new google.maps.InfoWindow( { content: message, size: new google.maps.Size(50,50) }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); } <body onload="initialize()"> <div id="map_canvas" style="width:1000px; height:500px"></div> <input type="text" name="description" value="" id="description" size="20"> </body> 29 Web Technologies
  • 30. Overview ● What's an API? ● Google APIs ● List of all APIs ● Google Custom Search API ● YouTube API ● Google Maps API ● Example Google Maps API ● Adding map ● Adding mouse event listener ● Adding User Input to Map ● MashUp (Live Coding) 30 Web Technologies
  • 31. Mashup User Input (e.g a click) Google Maps API Maps API output = YouTube API input YouTube API Google Maps Video Finder 31 Web Technologies
  • 32. Any other places you want to travel to? Thank you, for your attention. 32 Web Technologies