Created
July 10, 2023 20:12
-
-
Save alecbw/1260d3f30de9ab4dee5db94dd127f674 to your computer and use it in GitHub Desktop.
Revisions
-
alecbw created this gist
Jul 10, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ import requests import json import os ## Option 1 - query the companies dataset, pull pre-aggregated data response = requests.get( "https://sourcestack-api.com/companies?url=Copy.ai&fields=open_job_names,open_job_tech_use", headers={"X-API-KEY": os.environ["SOURCESTACK_KEY"]} ) ## Option 2 - query jobs directly, aggregate afterwards response = requests.post( "https://sourcestack-api.com/jobs", headers={ "X-API-KEY": os.environ["SOURCESTACK_KEY"], "Content-Type": 'application/json' # this must be included for POSTs }, data=json.dumps({ "count_only": False, "fields": ["job_name", "department", "seniority", "tech_use"], "filters": [{"field": "company_url", "operator": "EQUALS", "value": "Copy.ai"}] }) ) print(response.json())