Try below approach using python - requests simple, straightforward, reliable, fast and less code is required when it comes to requests. I have fetched the API URL from website itself after inspecting the network section of google chrome browser.
What exactly below script is doing:
- First it will take the API URL and payload (very important to do a POST request) to do a POST request and get the data in return.
- After getting the data script will parse the JSON data using json.loads library.
- At last it will iterate all over the list of stations one by one and print the details like State name, City name, Station name and Station Site Id.
Network call tab

Output of below code.

def scrape_aqi_site_id():
URL = 'https://app.cpcbccr.com/aqi_dashboard/aqi_station_all_india' #API URL
payload = 'eyJ0aW1lIjoxNjAzMTA0NTczNDYzLCJ0aW1lWm9uZU9mZnNldCI6LTMzMH0=' #Unique payload fetched from the network request
response = requests.post(URL,data=payload,verify=False) #POST request to get the data using URL and Payload information
result = json.loads(response.text) # parse the JSON object using json library
extracted_states = result['stations']
for state in range(len(extracted_states)): # loop over extracted states and its stations data.
print('=' * 120)
print('Scraping station data for state : ' + extracted_states[state]['stateID'])
for station in range(len(extracted_states[state]['stationsInCity'])): # loop over each state station data to get the information of stations
print('-' * 100)
print('Scraping data for city and its station : City (' + extracted_states[state]['stationsInCity'][station]['cityID'] + ') & station (' + extracted_states[state]['stationsInCity'][station]['name'] + ')')
print('City :' + extracted_states[state]['stationsInCity'][station]['cityID'])
print('Station Name : ' + extracted_states[state]['stationsInCity'][station]['name'])
print('Station Site Id : ' + extracted_states[state]['stationsInCity'][station]['id'])
print('-' * 100)
print('Scraping of data for state : (' + extracted_states[state]['stateID'] + ') is conmpleted now going for another one...')
print('=' * 120)
scrape_aqi_site_id()