api/v2/estimatefee - Litecoin

This endpoint returns the backend fee estimate for a target number of blocks to confirmation. The result is a fee rate in LTC per kilobyte.

Parameters

ParameterTypeLocationRequiredDescription
blocksintegerpathYesConfirmation target in blocks
conservativebooleanqueryNoUse conservative smart fee estimation. Default true

Request

bashcurl --location --request GET 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/estimatefee/6?conservative=true'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/estimatefee/6?conservative=true'
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/estimatefee/6?conservative=true')

print(response.json())

Response

json{
    "result": "0.00000994"
}

Response Parameters

FieldTypeDescription
resultstringEstimated fee rate as a decimal amount in LTC per kilobyte

The rate is quoted per kilobyte in whole LTC. Multiply by 100,000,000 and divide by 1000 to get litoshis per byte: the 0.00000994 above is roughly 0.99 litoshis/byte. The WebSocket estimateFee method returns the same estimate as an integer count of litoshis per kilobyte instead.

Use Cases

  • Fee Selection: Choose a rate matching the confirmation speed a payment needs
  • Cost Preview: Show the user the fee before signing
  • Batch Planning: Size a consolidation against the current rate

Error Handling

HTTP StatusMessageDescription
400Bad requestThe confirmation target is not a valid integer
403ForbiddenMissing or invalid ACCESS-TOKEN
500Internal errorThe node failed to return an estimate