We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 774628d commit 8f95e6cCopy full SHA for 8f95e6c
censys/search/v2/api.py
@@ -100,6 +100,9 @@ class Query(Iterable):
100
For more details, see our documentation: https://search.censys.io/api
101
"""
102
103
+ # Total number of results (Set after first query)
104
+ total: Optional[int] = None
105
+
106
def __init__(
107
self,
108
api: "CensysSearchAPIv2",
@@ -162,8 +165,9 @@ def __call__(self, per_page: Optional[int] = None) -> List[dict]:
162
165
)
163
166
self.page += 1
164
167
result = payload["result"]
168
+ self.total = result["total"]
169
self.nextCursor = result["links"].get("next")
- if result["total"] == 0 or not self.nextCursor:
170
+ if self.total == 0 or not self.nextCursor:
171
self.pages = 0
172
return result["hits"]
173
0 commit comments