The current, latest version of the Molport API is v3.0. To prevent broken experiences for people, we strongly
recommend to upgrade your application to the latest API version. Please, visit Molport API History of Changes for the
latest changes in API interfaces and/or data structures.
Molport API is implemented as REST interfaces. REST stands for Representational State Transfer. It relies on a
stateless, client-server, cacheable communications. JSON (JavaScript Object Notation) is used as a lightweight
data-interchange format.
Molport JSON request generic form is specific for API interface. Please, check the API Documentation to see the data structures that are used.
Molport JSON response generic form:
URL |
|
REQUEST |
|
RESPONSE |
{
"Result": {
"Status": 1,
"Message": "Molecule found!"
},
"Data": {
"Molecule": {
"Id": 2325020,
"Molport Id": "Molport-002-325-020",
"SMILES": "CCOC(O)c1[nH]c2ccc(C)cc2c1NC(O)CC",
"IUPAC": "ethyl 5-methyl-3-propanamido-1H-indole-2-carboxylate",
"Formula": "C15H18N2O3",
"Molecular Weight": 274.32,
"Status": "shop",
"Type": "stock",
"Largest Stock": "124",
"Largest Stock Measure": "mg",
"Largest Stock Measure Id": 234,
"Catalogues": {
"Screening Block Suppliers": [
{
"Supplier Name": "Specs",
"Supplier Id": 2070,
"Minimum Order": 200,
"Currency": "USD",
"Currency Id": 2,
"Catalogues": [
{
"Catalog Id": 84777984,
"Catalog Number": "AG-690/10530016",
"Stock": 2,
"Stock Measure": "mg",
"Stock Measure Id": 234,
"Last Update Date": "today",
"Available Packings": [
{
"Amount": 2,
"Measure": "mg",
"Measure Id": 234,
"Price": 32.20,
"Currency": "USD",
"Currency Id": 2,
"Delivery Days": 7
}
]
}
],
"Shipment Costs": [
{
"Price": 50,
"Currency": "USD",
"Currency Id": 2,
"Location Type": "REGION",
"Location": "EUROPE",
"Location Id": 1,
"Shipment Type": "Basic Shipping",
"Shipment Type Id": 3
},
{
"Price": 50,
"Currency": "USD",
"Currency Id": 2,
"Location Type": "REGION",
"Location": "USA",
"Location Id": 2,
"Shipment Type": "Basic Shipping",
"Shipment Type Id": 3
},
{
"Price": 50,
"Currency": "USD",
"Currency Id": 2,
"Location Type": "REGION",
"Location": "CANADA AND MEXICO",
"Location Id": 3,
"Shipment Type": "Basic Shipping",
"Shipment Type Id": 3
},
{
"Price": 50,
"Currency": "USD",
"Currency Id": 2,
"Location Type": "REGION",
"Location": "OTHER LOCATIONS",
"Location Id": 4,
"Shipment Type": "Basic Shipping",
"Shipment Type Id": 3
}
]
},
],
},
"Synonyms": [
"ethyl",
"ethyl 5-methyl-3-(propanoylamino)-1H-indole-2-carboxylate"
],
},
"Version": "v.3.0.1",
}
}
|
You can make up to 3 chemical search queries simultaneously. After exceeding this limit, an error announcement
will appear that will limit your search traffic.
You can also make 3 active molecule catalog search queries to retrieve information from our database in parallel
to chemical search queries. Similarly the same error announcement will appear when exceeding this limit.
Each users API account is limited to 10000 requests per month, meaning each user can submit up to 10000 requests
each month. The remaining request count is refreshed at the start of each month. If you require more requests
per month you can contact sales@molport.com to request an increased
monthly cap.
How to run the CURL sample
Example below describes how to run the CURL sample. Please, perform the following steps:
- Install CURL:
a: On Win machine install CURL or Cygwin.
b: On LINUX/Mac machine CURL is available out of the box.
- Execute in command line API request with CURL.
curl --header "Content-Type: application/json" --request POST --data '{"API
Key":"880d8343-8ui2-418c-9g7a-68b4e2e78c8b","Structure":"CC(C)(C)OC(=O)N1CCCCCC1C(O)=O","Search
Type":"4","Maximum Search Time":60000,"Maximum Result Count":10000,"Chemical Similarity Index":0.9}'
https://api.molport.com/api/chemical-search/search
How to run the JavaScript sample
Example below describes how to run the CURL sample.
Please, perform the following steps:
- Download the Molport archive MolPort-Molecule-v.3.0.zip with HTML file. Decompress the download archive.
- Open HTML file in browser.
- Enter username and authentication code provided by Molport.
- Specify SMILES and chemical search type.
- Execute chemical search.
Source
Provided example uses AJAX (JSONP) to overcome cross-domain limitations. jQuery library is used to execute AJAX requests. Current example can be used reused without any limitations.
Limitations
Please, contact Molport to aquire username and password/authentification code.
How to run the Java sample
Example below describes how to run the Molport Java API demo project on Microsoft Windows
platform. With minor modifications, it can be run on NIX platforms (Linux, AIX, etc.) too.
To use the jar and run the application, perform the following steps:
- Download and install latest Oracle Java version. Remember, to download the correct bit version of install package. For example, if OS is 64-bit version, install 64-bit version of Java.
- Download the Molport archive Molport-Molecule-v.3.0.zip with executable jar file and Java source.
- Create test directory C:\molport-test.
- Unarchive zip package, copy test-jar.jar and lib directory with jar's from bin directory of archive to test directory.
- Change active directory to test directory - execute cd C:\molport-test in command prompt (Start -> run -> cmd).
- Run test jar with username and password provided by Molport.
To execute chemical search:
java -jar test-jar.jar <username> <password> chemicalsearch <SMILES> <search type>
Sample for CC(C)(C)OC(=O)N1CCCCCC1C(O)=O exact fragment search:
java -jar test-jar.jar <username> <password> chemicalsearch CC(C)(C)OC(=O)N1CCCCCC1C(O)=O 6
To load information about molecule:
java -jar test-jar.jar <username> <password> loadmolecule <Molport molecule id>
Sample for molecule Molport-002-463-875:
java -jar test-jar.jar <username> <password> loadmolecule Molport-002-463-875
Build from Java source
- The MolPort-Molecule-v.3.0.zip archive contains directory src with Java source files. Create a new empty command line project in your preferred Java IDE (Eclipse, Oracle JDeveloper, NetBeans, etc.) and add source files to the project.
- The MolPort-Molecule-v.3.0.zip archive contains directory lib with dependant *.jar files from Apache HttpComponents project.
- Build the Java project.
- Run the main class Main.java and provide username, user password and Molport molecule ID as input arguments.
- Check the output.
- Implement the routines for data processing (deserialization for all returned data fields, data storing in database, file, etc.).
- If necessary, deploy functionality as jar file using standard deployment descriptors provided by IDE or build jar with ANT.
Limitations
Please, contact Molport to aquire username and password/authentification code.
How to run the C# sample
Example below describes how to run the Molport C# API demo project on Microsoft Windows platform.
To use the exe, perform the following steps:
- Install Microsoft .Net 4.5 Framework if it is not already installed on machine.
- Download the Molport archive Molport-Molecule-v.3.0.zip with executable exe file and C# project.
- Create test directory C:\molport-test.
- Unarchive zip package, copy MolPortAPIExample.exe from bin directory to test directory.
- Change active directory to test directory - cd C:\molport-test in command prompt (Start -> run -> cmd).
- Run MolPortAPIExample.exe with username and password provided by Molport.
To execute chemical search:
MolPortAPIExample.exe <username> <password> chemicalsearch <SMILES>
Sample for CC(C)(C)OC(=O)N1CCCCCC1C(O)=O exact fragment search:
MolPortAPIExample.exe <username> <password> chemicalsearch CC(C)(C)OC(=O)N1CCCCCC1C(O)=O
To load information about molecule:
MolPortAPIExample.exe <username> <password> moleculesearch <Molport molecule id>
Sample for molecule Molport-002-463-875:
MolPortAPIExample.exe <username> <password> moleculesearch Molport-002-463-875
Build from C# source
- Unarchive the Molport-Molecule-v.3.0.zip archive.
- Open the MolPortExample.csproj project file in Microsoft Visual Studio Community 2017.
- Open the project properties and in section Debug fill field Command line arguments providing username, user password, action and search value (Molport molecule ID|SMILES) as input arguments.
- Build and run the demo project.
- Check the console output.
Limitations
Please, contact Molport to aquire username and password/authentification code.
How to run the Python sample
Example below describes how to run the Molport Python API demo sample on Microsoft Windows
platform. To run te script, perform the following steps:
- Download and install latest Python version (v.3.9.1 at the moment of writing this guide).
- Open the Command Prompt - click on Windows Start Menu -> Run -> type in: cmd -> press Ok.
- Execute the following command: py -m pip install requests. It will install an additional module required to run the script.
- Create test directory C:\molport-test.
- Download the Molport archive Molport-Molecule-v.3.0.Python.zip with py API test script file and unarchive zip package in test directory.
- By using cd command, navigate to the directory C:\molport-test containing the script file.
- Run the script with the following command: py python_example.py. The result will be printed in the console, and a .json file will be created in the script directory.
Limitations
Please, contact Molport to aquire username and password/authentification code.
What could we do to improve your experience?