Get Cost Basis Report
GET
/api/v1/wallets/{address}/cost-basis
const url = 'https://api.qeychain.xyz/api/v1/wallets/example/cost-basis?method=fifo&page=1&per_page=50';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.qeychain.xyz/api/v1/wallets/example/cost-basis?method=fifo&page=1&per_page=50'Get full lot-level cost basis report.
Returns detailed lot information with cost basis breakdown. Supports different cost basis methods (FIFO is default).
Note: The method parameter changes the ordering of lots for
consumption purposes. FIFO orders oldest first, LIFO newest first,
HIFO highest cost first. The actual lot data remains the same;
only the suggested consumption order differs.
Response Format:
{
"success": true,
"data": {
"method": "fifo",
"total_cost_basis": "35000.00",
"lots": [
{
"lot_id": "ETH-001",
"symbol": "ETH",
"quantity": "1.0",
"cost_per_unit": "3000.00",
"acquisition_date": "2024-01-15T...",
"is_long_term": true,
"fifo_order": 1
}
]
},
"meta": {...},
"pagination": {...}
}
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”address
required
Address
string
Query Parameters
Section titled “Query Parameters”method
Method
Cost basis method: fifo (default), lifo, hifo, specific_id
string
Cost basis method: fifo (default), lifo, hifo, specific_id
page
Page
Page number
integer
Page number
per_page
Per Page
Items per page
integer
Items per page
owned_wallets
Any of:
Array<string>
null
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
Response Get Cost Basis Report Api V1 Wallets Address Cost Basis Get
object
key
additional properties
any
Examplegenerated
{}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}