Created
July 10, 2023 20:12
-
-
Save alecbw/1260d3f30de9ab4dee5db94dd127f674 to your computer and use it in GitHub Desktop.
This file contains 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 characters
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()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment