Created
September 5, 2023 20:53
-
-
Save alecbw/9b4e6f21185abb3bc36a6fa2f9c973e3 to your computer and use it in GitHub Desktop.
Revisions
-
alecbw created this gist
Sep 5, 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,29 @@ const axios = require('axios'); const data = { "count_only": false, "limit": 100, "export": "caller", // returns JSON "fields": ["job_name", "department", "hours", "seniority", "remote", "company_name", "company_url", "post_url_https", "board_url", "tags_matched", "tag_categories", "categories", "company_categories", "job_location", "city", "region", "country", "addresses", "comp_est", "comp_range", "language", "twitter_url", "linkedin_url", "github_url", "logo_url", "contact_url", "about_url", "author", "emails", "last_indexed", "job_published_at", "post_html", "company_description", "alexa_rank", "domcop_rank"], "filters": [ {"field": "categories", "operator": "CONTAINS_ANY", "value": ["Graphic Design", "Logo Design"]}, {"field": "country", "operator": "IS_IN", "value": ['United States', 'Canada']}, {"field": "company_url", "operator": "NOT_EQUALS", "value": null} ] }; const jsonData = JSON.stringify(data); const headers = { 'Content-Type': 'application/json', 'X-API-KEY': process.env.SOURCESTACK_KEY }; axios.post('https://sourcestack-api.com/jobs', jsonData, { headers }) .then((response) => { console.log('Response:', response.data); }) .catch((error) => { console.error('Error:', error); });