Teach the Earth > Teaching Methods > Teaching with Google Earth > Google Earth API
The Google Earth API (application programming interface) enables developers to embed Google Earth applications into web pages with JavaScript code. With the Google Earth API plugin installed, these applications can run interactively in web browsers. The API can display placemarks, lines, polygons, overlays, and 3D models on the imagery, just as the standalone versions of Google Earth can. The plugin supports several of the Google Earth layers, including terrain, roads, borders, and buildings. It can switch to Google Sky Mode for views of planets, stars, and galaxies. Because it enables scripting, it offers great potential for the development of educational and other material. Initially, it was available only for Windows, but now that it is available on the Macintosh as well, the rate of development of applications has increased.

A screen capture of a portion of the Google Earth API Interactive Samples example in Sky Mode




Developers who create web pages with the Google Earth API need to get a Google Maps key to specify in the code for these pages. The also need to write JavaScript code to implement the Google Earth API applications in the web pages. In order to run the applications in browsers, developers and end users need to install the Google Earth plugin. Although the plugin runs on Windows and the Macintosh, it is not yet available for Linux. On Windows, it is compatible with the following browsers:
On the Macintosh, with OS X 10.4 and higher, it is available for the following browsers:

Examples of Applications Developed with the Google Earth API

Some examples that were developed using the Google Earth API can be found in the Google Earth API Demo Gallery. A simple example, designed to help new developers get started is Hello, Earth. The Google Earth Plug-in Driving Simulator is more complex and more fun. Another playful example is the Monster Milktruck. Beginning with the Hello, Earth example, new developers can use these examples as templates that they can alter in order to learn and to develop their own material. In each case, they will need to replace the Google Maps key in the example with their own Google Maps key in order to offer the application from their server.

The New KML Interactive Sampler is a tool for learning KML that was developed using the Google Earth API.

Exploring the Google Earth API discusses an example that displays weather information. A full-page version of this weather mashup is located at Google Earth API Flex Integration.


The Google Earth API weather mashup. Note the flash flood warnings along the coast due to Hurricane Kyle. The weather mashup can be used as a template for developing other mashups.



The Walking Highlands map was created with the Google Earth API. With some modification, it could be developed into an application for exploring geological features.



The Google Earth API Driving Simulator at the Ramapo Fault. The fault divides the flat Newark Basin in the foreground from the Hudson Highlands in the background.



Idea for using the Driving Simulator for education: Have students choose directions that will take them along routes that pass specified geomorphic features. They are asked to pause the application, set the view, and capture images of the specified features for a report.


Driving across the Brooklyn Bridge to Manhattan, using the Google Earth Plug-in Driving Simulator.



Students can use the Driving Simulator to visit and learn about cultural features as well.

Information from Google on the Google Earth API

Here's the original press release by Google: Bringing the Power of Google Earth to the Browser.

To find out how to get started with the Google Earth API, and for a short video, see What is the Google Earth API?

For more details, see Google Earth API Developers Guide.

For additional examples, see Google Earth API Examples.

Other Sources of Information

Google Earth in a Browser contains several examples that use the Google Earth API.

Frank Taylor discusses the API in the Google Earth Blog at Google Earth Mashups on a Web Page Starting Today, Google Earth Plugin Adopted Quickly, More on Google Earth Plugin API, GE License Changes, and Google Earth API Demo Gallery.

Ogle Earth discusses the API at More early adopters of the Google Earth plugin.

The Thematic Mapping Blog has information about geobrowsers in general and specific material about the Google Earth API with links to examples.

O'Reilly Radar has an article on the API at Google Earth Escapes the Client and Comes to the Browser.

EarthSwoop uses maps based on the Google Earth API to enable people to share and view collections of interesting sites around the world, rendered in 3D with the terrain layer.

EarthSwoop map of glacial features of Snowdonia based on the Google Earth API



Google Maps Mania discusses the API at Google Maps Using the Google Earth Browser.

See another discussion at Google Earth for Browser Mashup with ArcGIS JavaScript.

Nearby.co has examples at Geograph Superlayer and playing with layers and controls. Geograph Superlayer offers links on a Google Earth API map to photographs taken throughout the UK.

Video Earth has links on a map to videos taken in many parts of the world.

Walking Highlands offers a Google Earth API map at Scotland on Virtual Highlands.

A Google Earth view can also be added to a Google Maps page with some JavaScript coding. Nevada Site Search is a business-oriented application that provies site selection data to businesses. The Earth button on the upper-right corner of the map switches to the Earth view.

A discussion group is located at KML Developer Support: Discussions > Google Earth Browser Plugin.

On ProgrammableWeb, Kevin Farnham comments on the API at Google Earth API Opens the World to Browsers.