How to Authenticate Using X-API-KEY with the SWEP Calculation API
To securely access the SWEP Calculation API, you need to authenticate each request using your unique API key.
This key is provided to you during the registration process and must be included in the header of your API requests.
Below is a step-by-step guide on how to use the X-API-KEY
header for authentication.
REST API
You can find the complete REST API documentation, including available endpoints, request parameters, and response formats, at the following link
Scalar playground http://api.swep.net/scalar/v1
Swagger playground http://api.swep.net/swagger/index.html
Redoc http://api.swep.net/redoc/index.html
POST /calculateSinglePhase HTTP/1.1
Host: api.swep.net
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Content-Length: 1402
{
"inputs": {
"calculationMethod": "Design",
"selectedFluidSide1": {
"fluidId": 53,
"isGas": false,
"inputValue": null
},
...
}
Below are sample scripts for accessing the REST API in various programming languages, tailored to your preferred development environment:
- C# - HttpClient
- C - libcurl
- cURL
- Dart - http
- HTTP
- Go - Native
- Java - OkHttp
- Kotlin
- Javascript - Fetch
- NodeJs
- PHP - cURL
- Python - Requests
- Python - http.client
- Ruby - Net:HTTP
GraphQL
Our GraphQL API provides a flexible and efficient way to query and manipulate data. You can explore and test our GraphQL API using the GraphQL UI available at the following link:
GraphQL playground http://api.swep.net/graphql/ui
POST /graphql HTTP/1.1
Host: api.swep.net
x-api-key: YOUR_API_KEY
Content-Type: application/json
Content-Length: 2082
{
"query": "query Calculate() {
calculateSinglePhase(request: {
inputs: {
calculationMethod: DESIGN,
selectedFluidSide1: {
fluidId: 53,
isGas: false,
inputValue: null
},
...
}"
}
Below are sample scripts for accessing the REST API in various programming languages, tailored to your preferred development environment:
- C# - HttpClient
- c - libcurl
- cURL
- Dart - http
- Go - native
- HTTP
- Javascript - Fetch
- Java - OkHttp
- Kotlin
- NodeJs - Request
- PHP - cURL
- Python - http.client
- Python - Requests
- Ruby - Net:HTTP
Sample GraphQL queries for different operations
- Calculate AHRI
- Calculate air dryer
- Calculate cascade
- Calculate condenser
- Calculate condenser dual
- Calculate district energy
- Calculate evaporator
- Calculate evaporator dual
- Calculate evaporator heat pump
- Calculate liquid evaporator
- Calculate single phase
- Calculate single phase dual
- Calculate two stage
- List available fluids
- List available heat exchangers
Support
If you have any questions or need further assistance, please get in touch with our support team at ssp@swep.net.