Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Querying a web database
#1
Good afternoon,

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.
Reply


Messages In This Thread
Querying a web database - by SimpleGuy - Aug-18-2017, 06:58 PM
RE: Querying a web database - by snippsat - Aug-18-2017, 07:22 PM
RE: Querying a web database - by SimpleGuy - Aug-18-2017, 08:25 PM
RE: Querying a web database - by Bass - Aug-18-2017, 07:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Basic SQL query using Py: Inserting or querying sqlite3 database not returning data marlonbown 3 1,423 Nov-08-2022, 07:16 PM
Last Post: marlonbown
  Fastest Method for Querying SQL Server with Python Pandas BuJayBelvin 7 7,003 Aug-02-2020, 06:21 PM
Last Post: jefsummers
  Recommendations: Querying CSV / Database?? ironfelix717 2 1,683 Apr-01-2020, 12:13 PM
Last Post: ndc85430
  Text Entry and Querying CSV whacky7 4 3,062 Mar-28-2019, 11:19 AM
Last Post: whacky7
  Querying cvs excel files rturus 6 3,542 Mar-27-2019, 02:08 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020