import requests
# Make a GET request to the WordPress theme search API
response = requests.get("https://api.wordpress.org/themes/info/1.2/?action=query_themes")
# Check if the request was successful
if response.status_code == 200:
# Extract the theme data from the response
theme_data = response.json()["themes"]
# Print the name and URL of each theme
for theme in theme_data:
print("Theme Name:", theme["name"])
print("Theme URL:", theme["url"])
print("-" * 20)
else:
print("Error retrieving themes:", response.text)