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
#6
(May-15-2023, 04:22 PM)alifihri Wrote: I think requesting HTML by API is denied.
Yes it is denied can be problem with domain you loop over,if look at Doc.
So should now do a simple test with the curl command in Doc or in Python it will be like this.
To see if your Api keys works,sometime the work for limit amount of time,then have to reactivate keys.
import requests

api_key = "YOUR_API_KEY"
api_secret = "YOUR_API_SECRET"
domain = "example.guru"

url = f"https://api.godaddy.com/v1/domains/available?domain={domain}"
headers = {
    "Authorization": f"sso-key {api_key}:{api_secret}"
}

response = requests.get(url, headers=headers)
print(response.status_code)
print(response.content)
If this work should check the domain you loop over it complain about appraisal/CharlotteComputerRepair.com" domain.
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 snippsat - May-15-2023, 05:30 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,739 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