Join Joe Chellman for an in-depth discussion in this video Parsing JSON data, part of jQuery Data with AJAX.
- View Offline
In this movie, we're going to make a real request from…the Sunlight Congress API and use it on our page.…So, here we are.…I can type in a zip code, a totally fake zip code and I'm putting in a message.…So let's make a real request.…To do that, we're going to need to know what to make a request of.…So, let's take a look at the Sunlight page.…So, I'm here on the Sunlight Congress API page.…Every service is going to be different. Sunlight has good documentation,…not every one will, but here, we're looking for some methods that we can call.…
So, we're looking to find the location of our legislators in…the area that we're interested in, and Sunlight has a legislators…/ locate method, and we can use it to find our…reps or our senators by latitude and longitude or zip code.…Great.…So, let's look at that page. So, as it says, we need an API key.…And then it shows…us an example of what a request can look like.…We just call this URL, / legislator / locate and then…we pass in the parameters by which we want to search.…
This course is a short companion piece to jQuery for Web Designers. See that course for information about building your core jQuery skill set.