Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SalaryAPI.com full logo

SalaryAPI integration examples

Official, runnable examples for salary benchmarks and gross-to-net salary calculations with SalaryAPI.

The repository uses only standard runtime features. The JavaScript and Python examples need no third-party packages.

Available endpoints

Use case Endpoint Documentation
Salary benchmarks POST /api/v1/salary-benchmarks Salary benchmark API
Gross-to-net calculation POST /api/v1/net-salary Net salary API

The complete machine-readable contract is available in the OpenAPI 3.1 specification.

You can also explore the requests in the public SalaryAPI Postman collection.

Requirements

  • A SalaryAPI account with API access or an active API trial
  • A SalaryAPI key from the developer dashboard
  • One of: cURL, Node.js 18 or newer, or Python 3.10 or newer

See the current SalaryAPI plans for access and usage limits.

Set your API key

Keep the key outside the source code. Never commit it to Git.

macOS or Linux:

export SALARYAPI_KEY="replace_with_your_api_key"

PowerShell:

$env:SALARYAPI_KEY = "replace_with_your_api_key"

Run the examples

JavaScript

node examples/javascript/salary-benchmark.mjs
node examples/javascript/net-salary.mjs

Python

python examples/python/salary_benchmark.py
python examples/python/net_salary.py

cURL

sh examples/curl/salary-benchmark.sh
sh examples/curl/net-salary.sh

Each example prints the JSON response and exits with a nonzero status when the request fails.

Verify the examples

The check validates JavaScript syntax and confirms that the public OpenAPI contract still contains the endpoints and required fields used here.

npm run check

Python and shell syntax can be checked with:

python -m py_compile examples/python/_client.py examples/python/salary_benchmark.py examples/python/net_salary.py
bash -n examples/curl/salary-benchmark.sh examples/curl/net-salary.sh

Security

  • Read the API key from SALARYAPI_KEY
  • Do not put a real key in .env.example, source files, issues, or logs
  • Rotate a key from the SalaryAPI developer dashboard if it is exposed
  • Use the API from a trusted backend when an application would otherwise expose the key to a browser or mobile client

License

The examples are available under the MIT License.

About

Official Salary API examples for salary benchmarks and gross-to-net calculations

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages