Digested Protein DB REST API Documentation

Endpoint
GET https://digestedproteindb.pbf.hr/search.php

Retrieves peptide/protein ptmSearchResults filtered by a specific mass range or peptide query.
Returns ptmSearchResults in JSON format.

Query Parameters
Name Type Required Description
mass1 float Yes (or peptide) Lower bound of the mass range (inclusive). If peptide parameter is used, mass1 and mass2 will be calculated from its mass.
mass2 float Yes (or peptide) Upper bound of the mass range (inclusive).
peptide string No Peptide sequence. If provided, calculates mass1 and mass2 for the sequence.
page integer No Page number for pagination. Default is 1.
pageSize integer No Number of ptmSearchResults per page. Default is 10. Maximum allowed is 1000.
Request Example
GET https://digestedproteindb.pbf.hr/search.php?mass1=1247.5&mass2=1247.7&page=1&pageSize=10
Response

Content-Type: application/json

Response structure:

{
    "totalResult": 431,
    "memory": "2008 MB",
    "duration": "00:00:54.966",
    "page": 1,
    "pageSize": 10,
    "result": [
        {
            "1247.6087": [
                {
                    "seq": "SYTFHFKYR",
                    "acc": [
                        "A0A0C9U8Z7",
                        "A0A0C9UZS6",
                        "A0A0C9UMQ1"
                    ]
                },
                {
                    "seq": "AIGFDGWHAFK",
                    "acc": [
                        "A0A8J3B0H4",
                        "A4G425",
                        "A0A4R6G671"
                    ]
                }
                // ... more peptide objects for this mass
            ]
        }
        // ... more mass keys and peptide arrays
    ]
}

Top-level fields:

  • totalResult – Total number of matching entries.
  • memory – Memory usage for the request.
  • duration – Query execution time.
  • page – Current page number.
  • pageSize – Number of ptmSearchResults per page.
  • result – Array of objects, each key is the peptide mass (as a string/number), value is an array of peptide objects:
    • seq – Peptide sequence
    • acc – List of protein accession numbers for this peptide
Error Responses
  • 400 Bad Request – Returned if required parameters are missing or invalid.
    {"error": "Peptide is required"}
  • 500 Internal Server Error – Returned if the server encounters an error.
    {"error": "Error details"}
Example cURL Request
curl "https://digestedproteindb.pbf.hr/search.php?mass1=1247.5&mass2=1247.7&page=1&pageSize=10"
Usage Notes
  • Use either mass1/mass2 for direct mass range filtering or peptide for sequence-based mass search.
  • Each entry in result is an object with the mass as the key, mapping to an array of peptide/protein hitPeptides.
  • The endpoint is optimized for read-only, high-performance querying.
  • Maximum pageSize is 1000.
Implementation Note (Java server method)
private void handleBySearch(HttpServerExchange http) {
    if (http.isInIoThread()) {
        http.dispatch(this::handleBySearch);
        return;
    }
    Map<String, String> params = createParam(http);

    try {
        String peptide = params.getOrDefault("peptide", "");
        if (peptide.isEmpty()) {
            sendJsonResponse(http, StatusCodes.BAD_REQUEST,
                    "{\"error\": \"Peptide is required\"}");
            return;
        }
        double mass1 = BioUtil.calculateMassWidthH2O(peptide);
        double mass2 = mass1;
        int page = Integer.parseInt(params.getOrDefault("page", "1"));
        int pageSize = Integer.parseInt(params.getOrDefault("pageSize", "1000"));

        searchByMass(http, mass1, mass2, page, pageSize);
    } catch (Exception e) {
        sendJsonResponse(http, StatusCodes.INTERNAL_SERVER_ERROR,
                "{\"error\": \"" + e.getMessage() + "\"}");
    }
}

For peptide queries, mass is computed server-side and search is performed for that precise mass.