I'm trying to get the courses list of data from udemy api.
I get this message: You do not have permission to perform this action.
from bs4 import BeautifulSoup
import requests
client_id = "my client id"
client_secret = "my client secret"
client_id_secret = f"{client_id}:{client_secret}"
headers = {
"Accept": "application/json, text/plain, */*",
"Authorization": f"Basic {client_id_secret}",
"Content-Type": "application/json;charset=utf-8"
}
r = requests.get("https://www.udemy.com/api-2.0/courses/?page=1&page_size=10&search=python",headers=headers)
soup = BeautifulSoup( r.content , 'html.parser')
print(soup)
I'm expecting to get a list of courses and their URL.