All posts tagged ‘API’

File Under: APIs, Location

Get Local Search Results From Yahoo

Online maps are a popular way to spice up a site. To get the most use out of them, you need data to plot: addresses from a database, location clicks from the user or at least coordinates for the map’s center. With any map, you have to start somewhere.

If you’re low on data, you can fill in the map with local listings, such as those you’d find in the Yellow Pages. You can show coffee shops or pizza joints right along your other data, or even on its own.

In this tutorial I’ll show how to use Yahoo Local to search for nearby businesses and landmarks, then plot those locations on a Yahoo Map using the Ajax API.

Continue Reading “Get Local Search Results From Yahoo” »
File Under: Glossary

API

The application program interface (API) is a set of building blocks for programmers.

APIs are made up of routines, protocols, and tools. Most operating environments provide an API so that programmers can write applications consistent with that environment. For example, developing software using the Windows API ensures that your user interface will be consistent with other Windows applications, making it easier for users to learn your new programs.

Use on the Web

Web APIs provide simple ways to interact with websites. Using an API, you can extract public data from sites like del.icio.us, Flickr and Digg to create mashups, reuse data or just about anything else you can imagine.

APIs are also useful for extracting your own private data from a web service so that you can back it up elsewhere or display it on another site.

When talking about APIs you’ll here the following terms quite a bit.

Common Web API Related Terms

  • Web service/API — These terms are largely interchangeable and simple refer to the ways you can interact with the data on your favorite websites.
  • Method — A method is just one aspect of an API; you might also see methods refered to a functions. For instance, if you’re interacting with Flickr, you might want to get your public photos. To do so you would use the get_user_photos method.
  • Response — The information returned by the API method that you’ve called.
  • REST — Short for Representational State Transfer. REST treats data as a web document that lives at a specific URL. REST APIs use standard HTTP requests such as GET, PUT, HEAD, DELETE and POST to interact with data.
  • XML-RPC — This older API scheme formats method calls and responses as XML documents which are sent over HTTP.
  • SOAP — Simple Object Access Protocol. A W3C standard for passing messages across the network. SOAP is the successor to XML-RPC. It’s complexity has led many to disparage SOAP and with more APIs leaning toward REST, SOAP’s future is uncertain.
  • Ajax — Asynchronous JavaScript and XML. Technically it has nothing to do with APIs, however many sites using APIs send their queries out using Ajax which is partially responsible for the popularity of JSON.
  • JSON — JavaScript Object Notation. JSON’s main advantage is that it is easy to convert from JSON to nearly any other programming language. JSON uses key-value pairs and arrays, something common to PHP, Python, Perl, Ruby and most other languages. The portability of JSON has made it an increasingly popular choice for sites developing APIs.


Popular Web APIs

File Under: Glossary

Platform


Software developers need to know which platform their software will be running on. A platform can be an Intel processor running Windows, a Macintosh running System 8, or any combination of hardware and software that works together. Platforms are important for web designers to understand, because they need to make sure their pages will work on more than one platform. Different browsers display web pages differently on various platforms. Since the internet itself is a cross-platform system, designers need to test web pages on different combinations of machines and browsers to ensure the widest possible audience will be able to view their sites.

File Under: APIs, Location

Yahoo Maps API

This is the basic structure of a data call to Yahoo Maps’ API. This will draw a 500px by 300px map centered on Wired’s San Francisco offices, complete with zoom and pan controls. When the user clicks on the location marker, a pop-up box will appear with some text inside.

All of these attributes can be changed by modifying the code below. You’ll need to use your own API key.


Continue Reading “Yahoo Maps API” »

File Under: Location

Multi-map with Mapstraction

It seems every mapping website has an API these days. Google, Yahoo, Microsoft, Mapquest… how do you choose? With Mapstraction, you don’t have to.

Mapstraction is an open source abstracted JavaScript mapping library. You can write mapping code once, then switch between map providers by only changing two lines. Mapstraction is maintained by a group of geocode lovers who want to give developers options when creating maps.

To help you on your way to using Mapstraction, we’ll simply create a map we can display on a web page, and then add a marker to denote a particular location.

Continue Reading “Multi-map with Mapstraction” »