Merge pull request #1432 from L1ghtn1ng/dev

Update rocketreach api endpoint
This commit is contained in:
J.Townsend 2023-05-22 19:19:52 +01:00 committed by GitHub
commit 8bd362c2c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ def __init__(self, word, limit) -> None:
raise MissingKey('RocketReach')
self.hosts: Set = set()
self.proxy = False
self.baseurl = 'https://api.rocketreach.co/v2/api/search'
self.baseurl = 'https://rocketreach.co/api/v2/person/search'
self.links: Set = set()
self.limit = limit
@ -26,7 +26,7 @@ async def do_search(self) -> None:
'User-Agent': Core.get_user_agent()
}
next_page = 1 # track pagniation
next_page = 1 # track pagination
for count in range(1, self.limit):
data = f'{{"query":{{"company_domain": ["{self.word}"]}}, "start": {next_page}, "page_size": 100}}'
result = await AsyncFetcher.post_fetch(self.baseurl, headers=headers, data=data, json=True)
@ -49,7 +49,7 @@ async def do_search(self) -> None:
if next_page > int(result['pagination']['total']):
break
await asyncio.sleep(get_delay() + 2)
await asyncio.sleep(get_delay() + 5)
except Exception as e:
print(f'An exception has occurred: {e}')