Python Forum
how can I call the API using python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how can I call the API using python
#5
(May-15-2023, 01:43 AM)bowlofred Wrote: .content isn't a method the way .json() is, it's an attribute. You don't use parenthesis with it.

print(requests.get(appraisal.format(domain), headers=headers).content)

Thanks for your feedback, this is what I got:
b'<HTML><HEAD>\n<TITLE>Access Denied</TITLE>\n</HEAD><BODY>\n<H1>Access Denied</H1>\n \nYou don\'t have permission to access "http://api.godaddy.com/v1/appraisal/CharlotteComputerRepair.com" on this server.<P>\nReference #18.b551060.1684168161.5d08dd66\n</BODY>\n</HTML>\n'
Traceback (most recent call last):
  File "C:\Users\LENOVO\Desktop\already sold test\ok.py", line 64, in <module>
    comparable_sales = appraisal_res["comparable_sales"][0]  
                       ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
[Finished in 7.8s]
I think requesting HTML by API is denied.
Reply


Messages In This Thread
how can I call the API using python - by alifihri - May-14-2023, 10:09 PM
RE: how can I call the API using python - by alifihri - May-15-2023, 04:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Call pip3 from python folder build by me call pip3 from the /usr/bin Suryavarman 3 3,864 Oct-07-2019, 10:23 PM
Last Post: Suryavarman

Forum Jump:

User Panel Messages

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