Extract data from an API Python

Published: 17 January 2019
on channel: Learn 2 Excel
89,474
880

Published on January 17, 2019:

In this video, we will learn to get data from an API.
It is a fairly simple process:
1. start by importing the code
2. send a get request, get a response object
3. Get the status code..returns an integer on success
4. get the data
5. get data in a more readable json format


In the previous video, we learnt:
1. Connect to SQL Server database on aws
2. Create a table in SQL Server database
3. Insert data to the created table


Previous Video:
   • Connect insert and retreive data from SQL ...  


Additional Reading material:


Code
#Step 1 start by importing the code
import requests
#step 2 send a get request, get a response object
result=requests.get('https://developer.nrel.gov/api/alt-fu... api key here&location=Denver+CO')

#step 3: Get the status code..returns an integer on success
result.status_code

#step 4:get the data

result.text

#step 5: get data in a more readable json format

result.json()

Additional information

#register for api @
https://developer.nrel.gov/

#requests documentation
http://docs.python-requests.org/en/ma...


#understanding API'send
   • What is an API? (in 3 minutes)  


SUBSCRIBE to learn more about Power BI,Power Query, Power Pivot, Excel,SQL Server and Python!!
   / @learnexcelrelentless  



Our Playists:
SQL Playlist :https://goo.gl/PS5Ep6
DAX PlayList : https://goo.gl/S4W41D
Power BI PlayList: https://goo.gl/dXxvnB
Power Query Playlist: https://goo.gl/5QS7P4
Getting Started with Power BI:https://goo.gl/GHakLZ
Getting Started with Python: https://goo.gl/n24P3w
Data Science With Python:https://goo.gl/PeYCR5


ABOUT DAGDOO:
Website:
Home Page: http://www.dagdoo.org/
Power BI Tutorials: http://www.dagdoo.org/excel-learning/...


Questions? Comments and SUGESTIONS? You will find me here:

Twitter: @dagdooe

Category: Science & Technology
License: Standard YouTube License


On this page of the site you can watch the video online Extract data from an API Python with a duration of hours minute second in good quality, which was uploaded by the user Learn 2 Excel 17 January 2019, share the link with friends and acquaintances, this video has already been watched 89,474 times on youtube and it was liked by 880 viewers. Enjoy your viewing!