In order to acquire (up to) 100 titles then:
import requests
URL = 'https://newsapi.org/v2/everything'
PARAMS = {
'qInTitle': 'bangladesh',
'from': '2023-07-17',
'to': '2023-08-16',
'sortBy': 'popularity',
'language': 'en',
'apiKey': '45c28deca60947fd9ec4d8db2b2c4a81'
}
MAX = 100
with requests.get(URL, params=PARAMS) as response:
response.raise_for_status()
if (content := response.json()).get('status') == 'ok':
for article in content.get('articles', [])[:MAX]:
print(article.get('title'))
Output (partial):
Bangladesh grapples with record deadly outbreak of dengue fever - Reuters
Political party supporters, police clash in Bangladesh - Reuters
Bangladesh to tone down law critics accuse of crushing dissent - Reuters
Injured Tamim steps down as Bangladesh ODI captain, to miss Asia Cup - Reuters
...
Bangladesh dealing with worst dengue fever outbreak on record - Yahoo Canada Sports
WHO urges swift action as dengue cases surge in Bangladesh - Al Jazeera English
Boat carrying dozens sinks in Bangladesh capital Dhaka
UNICEF appeals for funding as record 300,000 children enrolled in Bangladesh Rohingya camps