You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f4a67b5
Browse filesBrowse the repository at this point in the historyBrowse files
himanshu
committed
added coin support in crypto endpoint and changes in readme file
newsdataapi allows you to create a library for accessing http services easily, in a centralized way. An API defined by newsdataapi will return a JSON object when called.
# API key authorization, Initialize the client with your API key
143
-
144
-
api = NewsDataApiClient(apikey="YOUR_API_KEY")
145
-
response = api.news_api()
146
-
147
-
# You can go to next page by providing Page parameter
148
-
149
-
response = api.news_api(page = "nextPage value")
150
-
151
-
# You can paginate till last page by providing Page parameter in Loop
152
-
153
-
page=None
154
-
while True:
155
-
response = api.news_api(page = page)
156
-
page = response.get('nextPage',None)
157
-
if not page:
158
-
break
159
-
160
-
```
161
-
162
-
<br />
163
-
164
-
### News API with Scrolling
165
-
166
-
```
167
-
# Note: Scrolling through all result will counsume api as per your defined size. you can also define max_result to stop scrolling at desired result size.scroll is avaliable in news_archive,news_api and news_crypto, it will return all result when scrolling is compleated.
168
-
169
-
from newsdataapi import NewsDataApiClient
170
-
171
-
# API key authorization, Initialize the client with your API key
0 commit comments