User guide · Programs and data
Programs and API tokens
Run searches from a program with an API token, through the routes the page uses.
Programs can run searches through the same routes the page uses.
- On the hosted service, and on a server whose sign-in takes API tokens, choose API tokens from your account button. Name the token and pick how long it lasts, up to 90 days (your server may set less). Copy it right away: the page shows it only once. An account may have 10 live tokens. The page shows when each token was last used, and Revoke ends one. Use demo data fills the name Demo program and the shortest time.
- The program sends the token with every request, as
Authorization: Bearer <token>, and acts as your account under the same rules. GET /api/openapi.jsondescribes the routes a program uses, in OpenAPI 3.1. It is open without sign-in.POST /api/batchesstarts 1 to 100 searches in one request. If any of them cannot run, none starts, and the answer lists each problem.GET /api/batches/:idgives the state of each search. An account may have 200 batch searches waiting or running. api-batch.json is a demo body of two exact text searches: add asnapshotIdfromGET /api/databasesto each search before you send it.GET /api/batches/:id/multi-hitscounts a batch's finished searches together, as Hit by several queries does for a query group:by=publicationorby=sequence, andminQueries, how many queries must hit a row for it to be listed, 2 unless set.identity,coverage,queryMatch,queryIdentity,hitIdentity,publishedFrom,publishedBeforeandofficeapply to each search, andGET /api/batches/:id/multi-hits.csvgives every row. A query group's search is one batch, named bybatchIdin the group'ssearches.DELETE /api/cases/:iddeletes a demo case you started. A case that is not a demo case answers 409 and stays.- On a search's patents,
GET /api/jobs/:id/publicationstakesgroup=familyfor one row per patent family, at its earliest publication, with its members and how they were joined, andlater=hideto fold the publications from on or after the Published before date and count them.GET /api/jobs/:id/applicantsandGET /api/jobs/:id/applicants.csvtakelater=hidetoo, and then count only the publications that stay.POST /api/jobs/:id/markstakesidsto keep or exclude up to 500 publications at once, such as a family's. The OpenAPI description gives every field. GET /api/jobstakestextto find your searches by name, or by the set or database they searched, andstatusto keep those in the states you list, such asqueued,running.GET /api/jobs/:id/requestgives the request a search was started with, query included.POST /api/groupsruns one search across 2 to 8 sets as a combined search, such as a protein query against Patent proteins, Patent DNA and Swiss-Prot. If one set cannot take the query, or the queue lacks room, none starts.GET /api/groups/:id/referencesgives one list: a patent or database entry that several sets found is one row, with its best measures, its earliest date and the sets that found it. It takes the filters, sorts,group=familyandlaterof a search's patents, plussetandkind. A mark throughPOST /api/groups/:id/marksreaches every search in the combined search. On the page, Search in starts one when you check two or more sets.GET /api/jobs/:id/hits/:rowgives one hit of a search by its row number, whatever the filters, with its mark.- On several servers that share one queue, a search of a snapshot has
shared: true.GET /api/jobs/:idaddsaheadwhile it waits: how many such searches wait before it.workernames the server that runs it or ran it, andretriescounts the times it was cut off.GET /api/statusaddsservers: the other servers that take searches now, and how many searches of a snapshot run at once. POST /api/cases/:id/imports?name=<file name>brings a result file into a case, as Import a result file does. Send the file itself as the body, asapplication/octet-stream, or asapplication/gzipwhen it is compressed.GET /api/cases/:id/imports/:jobId/unresolvedlists the rows that did not join, with their reasons. For a file whose columns you match, addcolumns=with a JSON column map, URL-encoded, such as{"hit":"Subject","identity":"% identity"}, and if you likeheader=with the header row's line anddelimiter=withcommaortab.GET /api/cases/:id/imports/:jobId/reportgives such an import's column map and its import report.POST /api/importstakes many files at once, as the Import page does. Send multipart/form-data:case, the ID of one of your cases, ortitle, a new case's name, then a part namedfilefor each file. The answer gives a line for each file.GET /api/sequencesgives a stored sequence's letters, as Fetch a sequence from the snapshot does. Give thesnapshotIdandsetfromGET /api/databases, thenaccession, orpublicationwithseqIdNo. The answer gives the sequence's type, length, set and snapshot, and every record in the set that matches.deltasadds the snapshot's additions, by their IDs fromGET /api/databases, separated by commas. A newer patent needs them, such as SEQ ID NO: 1 of US12788009B2, granted 2026-11-10:publication=US12788009B2&seqIdNo=1&deltas=<IDs>. A sequence longer than 1,000,000 letters comes in stretches: ask for one withfromandto.POST /api/listings?name=<file name>reads a sequence listing, as Import on the Listings tab does: WIPO ST.26 XML, ST.25 text, or a publication's full-text XML that holds its listing. Send the file itself as the body, asapplication/octet-stream, or asapplication/gzipwhen it is compressed. AskGET /api/listings/:iduntil itsstatusisreadyorfailed. ThenGET /api/listings/:id/sequences?letters=truegives the sequences as JSON, in SEQ ID order: each one's SEQ ID NO, type, length, letters and organism, and itsnotes, the notes the listing gives its features. A page holds up to 1,000,000 letters, andnextsays where the next page starts. The listing stays in your account until you delete it. To try it, send us12788009b2-listing.xml.- A token cannot make another token: that needs the browser. On the local workbench there are no tokens, and a program on the same computer calls
http://127.0.0.1:8765as the page does. - To send an application's documents into cases from another system, use a connector token: see Connectors.
- An assistant on your computer can call these routes for you through the assistant program: see Assistants.
Guide version 1.91.0 · For Sequences 0.155.0