Ordering σ-profiles in batch through an API, step by step
A batch of σ-profiles follows one pattern. Authenticate, submit one SMILES per job, poll until it is finished, download the .mfsig file and verify its hash.
Updated November 28, 2026
Ordering σ-profiles in batch follows one pattern whatever the client language. Authenticate once, submit one SMILES per job, poll each job until it is finished, download the .mfsig file and verify its content hash. The exact endpoints and parameter names are on the API documentation. This guide covers everything around those calls, which is where batch jobs actually fail.
The four calls every batch makes
Authenticate. Submit. Poll. Download. The API documentation gives each its address, its parameters and its response shape, and those details are the one thing this guide does not repeat, because they are versioned there. What follows is the shape of a reliable script around them.
Authentication is done once per session and the credential is kept out of the code, in an environment variable or a secrets manager. Submission takes one SMILES and returns a job reference. Polling asks for the state of that job at a sensible interval. Download fetches the finished .mfsig file. One SMILES, one job, one file. There is no bulk upload to get wrong and no partial result to interpret.
Before the first call, a manifest
A batch that cannot be audited afterwards is a batch you will run twice. Before submitting anything, build a manifest, one row per molecule, with these columns.
- Your own identifier, the one your project uses.
- The SMILES as you will submit it, canonical and isomeric, prepared as in the canonicalisation guide, with salts split into single fragments.
- The job reference returned at submission, empty until then.
- The final state, empty until the job ends.
- The content SHA-256 read from the downloaded file, empty until verified.
- The local path of the file.
Deduplicate on the canonical SMILES before submitting. Two rows with the same string get one job. Check the manifests of previous batches too. The same molecule computed twice with the same recipe gives the same result, so it is wasted budget. See pricing for what each order costs.
Keep the manifest as a CSV or a small SQLite database that you update after every call, not at the end. If the script dies at row 300, you resume at row 301.
Submitting and polling without hammering anyone
Submit sequentially or with a small, fixed concurrency. Record the job reference immediately. Then poll. A DFT single point on a drug-sized molecule takes minutes rather than milliseconds, so polling every second gains nothing and costs rate-limit budget. Start at a few seconds and back off geometrically to a cap, something like 5, 10, 20, 40 and 60 seconds. If the API returns a retry hint or a rate-limit response, honour it.
Treat every network error as retryable with a bounded number of attempts, and every state the documentation describes as terminal as final. Log each transition with a timestamp. The log is part of your provenance.
import hashlib, json, time
def run_batch(rows, client, poll_cap=60):
"""rows: manifest rows with 'id' and 'smiles'.
client: a thin wrapper around the calls documented at /docs/api,
exposing submit(smiles) -> job_ref, state(job_ref) -> str and
download(job_ref) -> bytes. Endpoint and field names live there."""
for row in rows:
if row.get("content_sha256"):
continue # done in an earlier run
job = client.submit(row["smiles"])
row["job"] = job
save_manifest(rows)
wait = 5
while True:
state = client.state(job)
if state in client.TERMINAL_STATES:
break
time.sleep(wait)
wait = min(wait * 2, poll_cap)
row["state"] = state
if state != client.DONE:
save_manifest(rows) # no file, e.g. SCF did not converge
continue
raw = client.download(job)
doc = json.loads(raw)
print(list(doc)) # top-level keys, see /anatomy
row["transport_sha256"] = hashlib.sha256(raw).hexdigest()
row["content_sha256"] = doc[HASH_KEY] # key name from /anatomy
path = f"profiles/{row['content_sha256']}.mfsig"
with open(path, "wb") as fh:
fh.write(raw)
row["path"] = path
save_manifest(rows)Downloading, verifying and filing
On download, write the bytes to disk unchanged, under a name derived from the content hash rather than from the SMILES, so that file names are safe and unique. Keep two hashes. The hash of the bytes as received proves that your copy was not altered in transit or in storage. The content SHA-256 inside the file is the identifier of the result, and how it is computed is described on the anatomy page. The content hashing guide explains the distinction.
Then open the file and run three checks before marking the row as done. The identity block carries the SMILES as written, which must equal what you submitted. The dropped list must be empty, if you prepared single fragments. The geometry convergence flag must be set. The file validation guide has a fuller list, including the comparison of the summed segment areas with the surface area field.
When a job ends without a file
If the SCF does not converge, no .mfsig file is written. This is a normal outcome of a batch and your script must treat it as one. Record the terminal state in the manifest, do not retry blindly, and review the molecule. The SCF convergence guide describes the usual causes. Often the SMILES is the problem, an unusual valence, a radical written by mistake or a charged species that the continuum struggles with. Fix the chemistry and resubmit once.
Report the batch with four numbers. Rows submitted, files received, jobs ended without a file, and duplicates skipped. Anyone reading the report later knows exactly what was done.
Key points
- Every batch is authenticate, submit one SMILES per job, poll, download. The endpoints and parameter names are on the API documentation page.
- Build and update a manifest row by row, so a batch can be audited and resumed.
- Deduplicate on canonical SMILES before submitting and check earlier manifests, so each molecule is paid for once.
- Poll with geometric backoff and honour any rate-limit response.
- A job that ends without a file is a normal outcome of SCF non-convergence. Record it, review the molecule, resubmit once.
Questions people ask
- Do I need to send all my SMILES in one request?
- No. The pattern is one SMILES per job. Submit each one, keep the job reference against your own record, then poll each job until it is finished and download its file. The exact endpoints and parameters are on the API documentation page.
- What happens when the SCF does not converge for a molecule?
- No .mfsig file is written for that molecule. Your batch script must treat a job that ends without a file as a normal outcome, record it in the manifest and move on. Review the SMILES before resubmitting, since the same input under the same recipe gives the same result.
- How do I avoid paying twice for the same molecule?
- Canonicalise and deduplicate the SMILES before submission, and keep a local manifest that maps each canonical string to its job and its file hash. Before submitting, check the manifest and those of earlier batches. See the pricing page for what each order costs.
Further reading
In practice: A .mfsig file is JSON and reads with the standard library. Ordering is done on the site or through the API described in the docs, and AI agents can read the published samples through the MCP server at /mcp.
Generate a σ-profile from your SMILES
Free converter for a profile you already have, a reference-grade DFT run with its provenance record when it has to be defensible.