Skip to content

Instantly share code, notes, and snippets.

@AbhiAgarwal
Last active August 29, 2015 14:00
Show Gist options
  • Save AbhiAgarwal/abdca29f5225e7e24754 to your computer and use it in GitHub Desktop.
Save AbhiAgarwal/abdca29f5225e7e24754 to your computer and use it in GitHub Desktop.
var queryAPI = function() {
$.ajax({
// URL of the API you want to access
url: 'https://housing.nyu.edu/api/nyuapirooms/RoomSpaceDescription/AH-002E1-1',
// When the data comes back
success: function(data) {
// Go through all the data
for(var eachval in data) {
// and print all of it out
console.log(data[eachval]["HallName"]);
console.log(data[eachval]["Street"]);
console.log(data[eachval]["Street2"]);
console.log(data[eachval]["City"]);
console.log(data[eachval]["StateProvince"]);
console.log(data[eachval]["Country"]);
}
}
});
};
// Call the function
queryAPI();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment