Extract data from an API Python

Publié le: 17 janvier 2019
sur la chaîne: 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


Sur cette page du site, vous pouvez voir la vidéo en ligne Extract data from an API Python durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Learn 2 Excel 17 janvier 2019, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 89,474 fois et il a aimé 880 téléspectateurs. Bon visionnage!