The Chemaxon Calculators and Predictors service is secured from unauthorized use by allowing only those API calls that provide proper authentication credentials. These credentials are in the form of an API key - a unique alphanumeric string associated to your AWS account.
Once you subscribe to the Calculators and Predictors service on AWS Marketplace, you will be redirected to our welcome page where you can redeem your API key.
{primary} Save the key and store it in a safe place. This is the only time we will show you the API key.
To gain access to our services, you must add the x-api-key
header to all of your requests. The value of the header can only be the API key and nothing else:
x-api-key: <YOUR_API_KEY>
For detailed examples check the Code examples section.
To revoke your API key, you have to unsubscribe from our services on the AWS Marketplace product page. This action triggers mechanisms in the background that revoke your API key immediately.
We don't provide this functionality as is, but you can unsubscribe from using Chemaxon Calculators and Predictors on AWS Marketplace product page and subscribe again. This has the effect of revoking your current API key and getting a new one.
Subscribing and unsubscribing to the service is free of charge. We only charge you for the API calls you make.
You can check any time if your API key is still valid at marketplace.calculators.cxn.io. In case of a valid API key we provide additional information, e.g. the pricing plan you chose. For more information, see Pricing.
Each request is allowed to run for a maximum of 25 seconds. After that time period your request calls a timeout and returns with HTTP status code 504 Gateway Timeout
.
A rate limit is the number of API calls a user can make within a given time period. Our system limits API calls to 50 request/sec. Please note that this is not hard limit but rather applied on a best-effort basis. In some cases you can exceed the rate that you set.
Calculators and Predictors on AWS Marketplace provides an API (/rest-v1/calculator/batch/calculate
) that allows calculations for multiple structures within a single call.
The maximum number of structures is limited to 25 structures.
A temporary API documentation can be found at this swagger page.
What is AWS PrivateLink?
AWS PrivateLink is a highly available, scalable technology that enables you to privately connect your VPC to services as if they were in your VPC. Therefore, you control the specific API endpoints, sites and services that are reachable from your VPC.
Available AWS regions and their endpoint service names for PrivateLink connection:
io.cxn.calculators.eu-west-1-vpce
io.cxn.calculators.us-east-2-vpce
How to connect to Chemaxon Calculators and Predictors using the PrivateLink option?
AWS Console:
private-api.calculators.cxn.io
address from the specified VPC.AWS CLI:
aws ec2 create-vpc-endpoint \
--service-name io.cxn.calculators.eu-west-1-vpce \
--vpc-endpoint-type Interface \
--vpc-id <vpc-id> \
--subnet-ids <subnet-id> \
--private-dns-enabled
Is it possible to use the service via PrivateLink from a VPC that is located outside of the available regions (e.g. us-west-1
)?
Yes, it is possible with the following steps:
us-east-2
.us-east-2
vs us-west-1
).The following section provides code examples in different languages on how to use a basic calculator (Elemental Analysis) by authenticating the request using the API key.
curl -X 'POST' \
'https://api.calculators.cxn.io/rest-v1/calculator/calculate/elemental-analysis' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{
"structure": "NC(CC1=CC=CC=C1)C(O)=O"
}'
const url = 'https://api.calculators.cxn.io/rest-v1/calculator/calculate/elemental-analysis';
const payload = {
structure: 'NC(CC1=CC=CC=C1)C(O)=O'
};
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY',
},
body: JSON.stringify(payload)
});
import requests
url = 'https://api.calculators.cxn.io/rest-v1/calculator/calculate/elemental-analysis'
payload = { 'structure': 'NC(CC1=CC=CC=C1)C(O)=O' }
my_headers = {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
response = requests.post(url, json=payload, headers=my_headers)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpRequest.BodyPublishers;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;
import com.google.gson.Gson;
public class App {
public static void main(String[] args) {
// This code requires Java 11 or newer
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.calculators.cxn.io/rest-v1/calculator/calculate/elemental-analysis"))
.header("x-api-key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(BodyPublishers.ofString("{ \"structure\": \"NC(CC1=CC=CC=C1)C(O)=O\" }"))
.timeout(Duration.ofSeconds(5))
.build();
var responseStr = HttpClient.newHttpClient()
.sendAsync(request, BodyHandlers.ofString())
.thenApply(HttpResponse::body)
.join();
// Multiple libraries are available to parse the JSON response, e.g., gson (https://github.com/google/gson)
var response = new Gson().fromJson(responseStr, Response.class);
}
static class Response {
private double mass;
private double exactMass;
private String formula;
// ... other fields
// ... getters, setters
}
}
Coming soon...
In case you need a new API key, you have to unsubscribe from this product on AWS Marketplace page and subscribe again. This process removes your previous API key associated to your account and assign a new one.
No, you can only have one API key associated to your AWS account.
Subscribing and unsubscribing to the service is free of charge. We only charge you for the API calls you make.
Each chemical calculation API call has a different price based on how complex the calculation is. For the detailed list, see Pricing.
The status page, integrated with out monitoring and alerting system, provides up-to-date information on the incidents, system status and planned maintenance.