Created by Ryan Whitley / @apollolm
Application Programming Interface
An API is a way for your program to 'talk' to another computer system and retrieve information.
APIs open up the world to your apps.
Access to real time data
Mashup multiple datasets in a single app
App integration
There are standards and common ways of access.
REST APIs - Looks like a URL
(Representational State Transfer)
http://data.seattle.gov/resource/7ais-f98f.json?$limit=10&offense_type=ASSLT-AGG-GUN
Common API response formats:
JSON - Javascript Object Notation
XML
[
{
offense_code: 1304
offense_type: ASSLT-AGG-GUN
census_tract_2000: 10100.5012
date_reported: 2010-04-18T02:13:00
location: {
needs_recoding: false
longitude: -122.288423546
latitude: 47.564962186
}
zone_beat: R1
offense_code_extension: 0
district_sector: R
hundred_block_location: 42XX BLOCK OF RAINIER AVE S
summarized_offense_description: ASSAULT
month: 4
general_offense_number:<PHONE_NUMBER>
year: 2010
longitude: -122.288423546
summary_offense_code: 1300
latitude: 47.564962186
rms_cdw_id: 31454
occurred_date_or_date_range_start: 2010-04-18T01:30:00
},
{
offense_code: 1304
offense_type: ASSLT-AGG-GUN
census_tract_2000: 9300.2017
date_reported: 2010-04-25T05:30:00
location: {
needs_recoding: false
longitude: -122.334193864
latitude: 47.593625482
}
occurred_date_range_end: 2010-04-25T05:30:00
zone_beat: K3
offense_code_extension: 0
district_sector: K
hundred_block_location: 9XX BLOCK
Let's say you have an idea to build an app that lists real-time 911 Fire Department calls (just go with it).
Several ways to get that list:
Buy a police scanner and listen for all 911 calls that go to the Fire Department.
This is time consuming and error prone. AND, you have to constantly listen to the scanner 24/7 to keep it up to date. You'd also have to write them all down or keep a spreadsheet with all of the details.
Have teams of people stationed at every fire station in Seattle. Whenever a fire truck pulls out, follow it and note the details.
Yeah, right.
Let somebody else worry about data collection!
Use an API!
Thankfully, the City of Seattle has a data portal - http://data.seattle.gov
Look at the 911 data: http://data.seattle.gov/resource/kzjm-xkqj.json
Each API has a specific set of 'endpoints'
Endpoints do a single job - handle a single topic
Find the endpoint(s) that provide the data you want
Time: ~15 Minutes
Don't worry. We'll go thru step by step.
HTML - the container for data to go into
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TechDiversified Worshop - The Power of APIs</title>
</head>
List of 911 Responses
</body>
</html>
Load jQuery - a javascript helper library
Call to the API (getJSON) - wait for response
Loop over each result and write it into the container
//After the API is successfully called, the flow comes here.
$.each(result, function(idx, item){
$("#myResults").append(item.type);
$("#myResults").append("
");
});
A boring, ugly list.
Time: ~10 Minutes
Same as before, but add a mapContainer div
Load Leaflet - a mapping library
Call to the API (getJSON) - wait for response
Same as before
Loop over each result and write it into the container
Also, add the item to the map
//After the API is successfully called, the flow comes here.
$.each(result, function(idx, item){
//Write the item to a list
$("#myResults").append(item.type);
$("#myResults").append("
");
//Add map marker
if(item.latitude && item.longitude){
L.marker([item.latitude, item.longitude]).addTo(map);
}
});
A slightly more usable visualization
Time: ~10 minutes
Try sorting or filtering the list by type (Try to only show the type 'Aid Response')
Try adding another piece of information to the list - incident # perhaps?
Try adding another dataset you find at http://data.seattle.gov - more items on the map, create a separate list
Meetup - http://www.meetup.com/meetup_api/
Foursquare - https://developer.foursquare.com/
Google (Tons of APIs) - Google API Explorer
Facebook - Facebook Graph API
Well not really.
But APIs can do more than just fetch data.
Certain APIs let you put new data in.
Or delete or alter data.
You could build your own API to track your location (for example)
Go forth, find interesting APIs, and start to fit some pieces together for your app
APIs provide your apps, websites or scripts access to data from the outside world.
Make your program come alive (not literally)(yet)
Build new apps off of existing data - make older experiences better
This presentation can be found at http://tech-diversified.github.io/Workshops/API101


In this release has been implemented, among others, a very efficient generic search component. New documentation has also been added and some bugs have been fixed.
Release NotesBig changes for Stark: it has been upgraded to Angular 7! New features such as a preloading screen, a session timeout warning, new stylings applicable to Stark table component have been added.
Release NotesThe next release of Stark is available right now! This release provides lots of packages update, new components such as Message Pane or Minimap, the implementation of a custom error handler, ...
Release NotesStark Logo was born this week!
Let's all make a round of applause for our java colleague, Maxime, who had the good idea to mix Angular's pretty logo with the name of our project! Thanks also to Carlo, who rearranged it to make it more portable on other browsers such as IE!


This module contains a description of all predefined finite set propagators. They can be reused, for example, for rewriting newly defined finite set propagators into already available propagators.
|
Classes |
| class | Gecode::Set::Convex::Convex |
| | Propagator for the convex constraint More...
|
| class | Gecode::Set::Convex::ConvexHull |
| | Propagator for the convex hull constraint More...
|
| class | Gecode::Set::Distinct::AtmostOne |
| | Propagator for the AtMostOneIntersection constraint More...
|
| class | Gecode::Set::Element::ElementIntersection< SView, RView > |
| | Propagator for element with intersection More...
|
| class | Gecode::Set::Element::ElementUnion< SView, RView > |
| | Propagator for element with union More...
|
| class | Gecode::Set::Element::ElementUnionConst< SView, RView > |
| | Propagator for element with union of constant sets More...
|
| class | Gecode::Set::Element::ElementDisjoint |
| | Propagator for element with disjointness More...
|
| class | Gecode::Set::Int::MinElement< View > |
| | Propator for minimum element More...
|
| class | Gecode::Set::Int::MaxElement< View > |
| | Propator for maximum element More...
|
| class | Gecode::Set::Int::Card< View > |
| | Propagator for cardinality More...
|
| class | Gecode::Set::Int::Match< View > |
| | Propagator for the match constraint More...
|
| class | Gecode::Set::Int::ChannelInt< View > |
| | Propagator for channelling between variable-value-dual models More...
|
| class | Gecode::Set::Int::ChannelBool< View > |
| | Propagator for channelling between set variable and its characteristic function More...
|
| class | Gecode::Set::Int::Weights< View > |
| | Propagator for weight of a set More...
|
| class | Gecode::Set::RelOp::SuperOfInter< View0, View1, View2 > |
| | Propagator for the superset of intersection More...
|
| class | Gecode::Set::RelOp::SubOfUnion< View0, View1, View2 > |
| | Propagator for the subset of union More...
|
| class | Gecode::Set::RelOp::Intersection< View0, View1, View2 > |
| | Propagator for ternary intersection More...
|
| class | Gecode::Set::RelOp::Union< View0, View1, View2 > |
| | Propagator for ternary union More...
|
| class | Gecode::Set::RelOp::IntersectionN< View0, View1 > |
| | Propagator for nary intersection More...
|
| class | Gecode::Set::RelOp::UnionN< View0, View1 > |
| | Propagator for nary union More...
|
| class | Gecode::Set::RelOp::PartitionN< View0, View1 > |
| | Propagator for nary partition More...
|
| class | Gecode::Set::Rel::SubSet< View0, View1 > |
| | Propagator for the subset constraint More...
|
| class | Gecode::Set::Rel::NoSubSet< View0, View1 > |
| | Propagator for the negated subset constraint More...
|
| class | Gecode::Set::Rel::ReSubset< View0, View1 > |
| | Reified subset propagator More...
|
| class | Gecode::Set::Rel::Eq< View0, View1 > |
| | Propagator for set equality More...
|
| class | Gecode::Set::Rel::ReEq< View0, View1 > |
| | Reified equality propagator More...
|
| class | Gecode::Set::Rel::Distinct< View0, View1 > |
| | Propagator for negated equality More...
|
| class | Gecode::Set::Rel::DistinctDoit< View0 > |
| | Propagator for negated equality More...
|
| class | Gecode::Set::Sequence::Seq |
| | Propagator for the sequence constraint More...
|
| class | Gecode::Set::Sequence::SeqU |
| | Propagator for the sequenced union constraint More...
|