stor 390 apis
play

STOR 390: APIs Marshall Markham Overview Intro to APIs Concept - PowerPoint PPT Presentation

STOR 390: APIs Marshall Markham Overview Intro to APIs Concept Steps to URI API Usage Google Maps Exercise What is an API API stands for Application Programming Interface Any body of code meant to be used by outside


  1. STOR 390: APIs Marshall Markham

  2. Overview • Intro to APIs Concept • Steps to URI API Usage • Google Maps Exercise

  3. What is an API • API stands for Application Programming Interface • Any body of code meant to be used by outside programmers represents an API • Web and Rest APIs • URI APIs

  4. Steps to URI API Usage 1. Recognize the problem may be solved by the use of an API 2. Read the docs 3. Sign up for access 4. Request sample data and review 5. Write formatting functions against the sample data 6. Get the full dataset

  5. Google Maps API Example Q: Suppose we are working for a company that has three datasets relating addresses to latitude, longitude coordinates and want to determine the most accurate. What do we do? A: Geocoding

  6. Step 1 • Identify the problem requires data and search for an online source.

  7. Step 2 • Read the docs to determine how to interact with the API • Simply google “Google Geocoding Documentation” and start digging

  8. Question 1 Q: What is an example geocoding request from google maps geocoding API? The answer may be found under “Sample Request and Response” at : https://developers.google.com/maps/document ation/geocoding/start

  9. Step 3 • Google requires that we have a key provided by them in order to use their geocoding service • Please sign up for an API key now

  10. Question 2 • Use the api key just obtained to submit the example http query to google maps • Use use your web browser to conduct this exercise • What was the place_id field in the response?

  11. Step 4 • Write code to turn the data you have into URI strings • Submit the code requesting 10 to 100 results • Review the results and consider whether the appropriate information is contained

  12. Step 5 • Write code to transform the data you received in the example request • Break the problem out into pieces and write them in individual functions • This is generally easier than trying to tackle the entire problem at once

  13. Step 6 • Test the request code and the result transformation code on one more 10 observation chunk • Pull a full request and parse it into the required dataset • Store the dataset

  14. Creating Sub-problems • In general, when confronted with a programming problem it is good to frame the larger problem as a set of manageable sub problems.

  15. Review of Steps 1. Recognize the problem may be solved by the use of an API 2. Read the docs 3. Sign up for access 4. Request sample data and review 5. Write formatting functions against the sample data 6. Get the full dataset

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend