Developer Documentation

Sentencing Calculator API

Embed release date calculations in your application. Our public API allows external websites to calculate prison release dates under the Sentencing Act 2026.

Authentication

Public API

No API key required

Rate Limit

60 requests/minute

Per IP address

Format

JSON

Request & Response

Endpoints

POST https://insideoutjustice.com/api/v1/sentencing/calculate

Calculate an estimated release date. Send a POST request with sentence details in the request body.

GET https://insideoutjustice.com/api/v1/sentencing/regimes

List the active sentencing regimes (release fractions, eligibility, warnings) used by the calculator.

Request Body — POST /calculate

Parameter Type Required Description
startDate string Yes Sentence start date (YYYY-MM-DD)
sentenceYears integer Yes Sentence length in years (0-99)
sentenceMonths integer No Additional months (0-11), default: 0
sentenceDays integer No Additional days (0-30), default: 0
remandCreditDays integer No Days on remand to credit, default: 0
taggedBailCreditDays integer No Tagged bail days to credit, default: 0
addedDays integer No Added days from adjudications, default: 0
sentenceType string No One of sds, sds_plus, section_250, eds, life, ipp, terrorism. Default: sds
ageAtSentence string No One of adult, child, unknown. Default: adult
regimeId string No Explicit regime ID (overrides sentenceType). See GET /regimes
postCommencement boolean No Use the post-commencement (SA 2026) fraction. Default: false

Invalid input returns HTTP 422 with an errors object keyed by field name. Exceeding the rate limit returns HTTP 429.

Response — POST /calculate

Example Response (200 OK)

{
  "success": true,
  "data": {
    "releaseDate": "2027-09-08",
    "sentenceEndDate": "2030-03-01",
    "totalDays": 1461,
    "custodyDays": 584,
    "adjustedCustodyDays": 556,
    "fractionUsed": 0.4,
    "fractionLabel": "two-fifths (40%)",
    "warnings": []
  },
  "inputs": {
    "startDate": "2026-03-01",
    "sentenceYears": 4,
    "sentenceMonths": 0,
    "sentenceDays": 0,
    "remandCreditDays": 28,
    "taggedBailCreditDays": 0,
    "addedDays": 0,
    "regimeId": "sds_adult",
    "postCommencement": false
  },
  "disclaimer": "This is an estimate only and is not legal advice. Actual release dates are determined by HMPPS.",
  "poweredBy": "Inside Out Justice - insideoutjustice.com"
}

The data object always contains releaseDate, sentenceEndDate, totalDays, custodyDays, adjustedCustodyDays, fractionUsed, fractionLabel and warnings.

Response — GET /regimes

Example Response (200 OK)

{
  "success": true,
  "data": [
    {
      "regimeId": "sds_adult",
      "displayName": "Standard Determinate Sentence (Adult)",
      "description": "Fixed-term sentence with automatic release.",
      "fractionPreCommencement": 0.4,
      "fractionPostCommencement": 0.3333333333,
      "commencementDate": null,
      "eligibilityAge": "adult",
      "isExcluded": false,
      "exclusionReason": null,
      "warnings": ["Estimate only."],
      "sourceLinks": []
    }
  ]
}

Code Examples

JavaScript
// JavaScript/TypeScript
const response = await fetch('https://insideoutjustice.com/api/v1/sentencing/calculate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
  },
  body: JSON.stringify({
    startDate: '2026-03-01',
    sentenceYears: 4,
    sentenceMonths: 0,
    sentenceDays: 0,
    remandCreditDays: 28,
    addedDays: 0,
    sentenceType: 'sds',
  }),
});

const result = await response.json();
console.log(result.data.releaseDate);
Python
# Python
import requests

response = requests.post(
    'https://insideoutjustice.com/api/v1/sentencing/calculate',
    headers={'Accept': 'application/json'},
    json={
        'startDate': '2026-03-01',
        'sentenceYears': 4,
        'sentenceMonths': 0,
        'sentenceDays': 0,
        'remandCreditDays': 28,
        'addedDays': 0,
        'sentenceType': 'sds',
    },
)

print(response.json()['data']['releaseDate'])
cURL
# cURL
curl -X POST 'https://insideoutjustice.com/api/v1/sentencing/calculate' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "startDate": "2026-03-01",
    "sentenceYears": 4,
    "sentenceMonths": 0,
    "sentenceDays": 0,
    "remandCreditDays": 28,
    "addedDays": 0,
    "sentenceType": "sds"
  }'

Try It

Interactive API Tester

Terms of Use

Important Disclaimer

This API is provided for informational and educational purposes only. Results are estimates and should not be relied upon for legal advice.

By using this API, you agree to:

  • Display a disclaimer that results are estimates only
  • Link back to Inside Out Justice when displaying results
  • Not use the API for commercial purposes without permission
  • Respect the rate limits (60 requests per minute)

Required Attribution

When displaying results from this API, please include the following attribution: