Aug-18-2017, 06:58 PM
Good afternoon,
I have been playing around with Requests to Query an API. Here is my code
I've been trying to help my self by Googling "How to Query an API with Python" but I get a bunch of links for MYSQL and I don't think that's what I'm looking for. I would just like to learn what I am doing wrong or read about the basics of Querying an API with Requests() in Python.
I have been playing around with Requests to Query an API. Here is my code
import json import requests data_url = 'http://sagisservices.thempc.org/saint/rest/services/OpenData/Coastal_LandCover/MapServer/4' r = requests.get(data_url) data = r.json()In this case it returns an error which I guess I dont understand because if you put the link into the browser the featuredserver says that it supports JSON, AMF.
I've been trying to help my self by Googling "How to Query an API with Python" but I get a bunch of links for MYSQL and I don't think that's what I'm looking for. I would just like to learn what I am doing wrong or read about the basics of Querying an API with Requests() in Python.