Advanced: fees
Search calculation chains
Finds calculation chains to reuse by binding or forking them.
GET /calculation-chains/search
Finds calculation chains to reuse by binding or forking them.
- Lists every chain you can see that is not deprecated: your own, official ones and those other users share.
owner(mine,officialorpublic) andsearch(a case-insensitive substring of the name) narrow it. websiteandpurposekeep only chains some binding uses on that marketplace or for that purpose.- Ordered by
ref_count, most used first, unlesssortsays otherwise; withpage(andpage_size, at most 100) one page with thetotal. - Each entry carries a readable
formula: a nominal amount of 100 flowing through the chain, or, for a chain that fixes no currency, its steps applied to a symbolic inputx(for examplex × 0.975); fetch the full chain withGET /calculation-chains/{calculation_chain_id}.
Usage
| Name | Description |
|---|---|
| Authentication | API key required |
| Credit cost | Free |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
website | query | string or null | No | Only return chains bound to this marketplace, by marketplace code. |
purpose | query | string or null | No | Only return chains bound for this purpose: deposit, sale or withdraw. |
owner | query | string or null | No | Which records to list. Omit for everything you can see. official: the platform's official records. public: records users share. mine: your own. Values: official, public, mine. |
search | query | string or null | No | Case-insensitive substring to match against the name. |
sort | query | string | No | Sort order: ref_count (default; most used first), name (official chains first) or updated_at (most recently changed first). Values: ref_count, name, updated_at. Default: ref_count. |
page | query | integer or null | No | Page number, from 1. When given, the response is a page (items, total, page, page_size) instead of the full list. |
page_size | query | integer | No | Records per page (1 to 100); used with page. Default: 20. |
Responses
| Status | Description | Schema |
|---|---|---|
200 | Successful Response | Envelope_Union_list_CalculationChainSearchOut___PageOut_CalculationChainSearchOut___ |
401 | Authentication is missing or invalid | ErrorEnvelope |
403 | The credential is valid but not allowed to call this operation | ErrorEnvelope |
422 | A parameter or the request body is invalid | ErrorEnvelope |
429 | Too many requests to this endpoint; retry later | ErrorEnvelope |
503 | The service is temporarily unavailable; retry later | ErrorEnvelope |
Models
CalculationChainSearchOut
A calculation chain found through search.
| Field | Type | Required | Description |
|---|---|---|---|
calculation_chain_id | integer | Yes | ID of the calculation chain. |
name | string or null | Yes | Display name, if set. |
revision | integer or null | Yes | Current revision of the chain. |
owner_user_id | string or null | Yes | ID of the owning user; null for a platform chain. |
is_official | boolean | Yes | Whether the chain is official. |
is_searchable | boolean | Yes | Whether the owner shares the chain. |
ref_count | integer | Yes | How many times the chain is bound or has been forked; results are sorted by it unless sort says otherwise. |
step_count | integer | Yes | Number of steps in the chain. |
formula | string or null | Yes | Readable arithmetic for the chain. With a start_currency, a nominal amount of 100 in it flows through the steps, each followed by its result, for example 100.00000000 USD → × 0.975 = 97.50000000 USD. Without one (no step fixes a currency, or there are no steps), the steps are applied in order to a symbolic input x, with parentheses where the order needs them, for example x × 0.975 or x × 0.98 ÷ 1.05; a chain with no steps is just x. null only when no formula can be built, for example when a chain without a start currency contains a group with no members. |
CreditMeta
Credit accounting for a billable request.
| Field | Type | Required | Description |
|---|---|---|---|
cost | integer | Yes | Credits this request costs. |
remaining | integer | Yes | Estimated credit balance left after this request. A hint rather than a ledger: concurrent requests can make it slightly off. |
Envelope_Union_list_CalculationChainSearchOut___PageOut_CalculationChainSearchOut___
| Field | Type | Required | Description |
|---|---|---|---|
data | array of CalculationChainSearchOut or PageOut_CalculationChainSearchOut_ | Yes | The endpoint payload. |
meta | Meta | Yes | Request metadata. |
ErrorBody
Details of a failed request.
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Stable machine-readable error code. Branch on this value, not on message. |
message | string | Yes | Human-readable explanation. The wording may change. |
details | object or null | No | Optional structured context, such as the list of validation errors or, for credit_insufficient, the required and remaining credits. |
ErrorEnvelope
Error response: the error in error plus request metadata in meta.
Meta
Request metadata included in every enveloped response.
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string | Yes | Unique identifier of this request, identical to the X-Request-ID response header. Quote it when contacting support. |
billable | boolean or null | No | Whether the request is billed in credits. Present only on metered endpoints; false means the request is free, for example because it costs nothing or your subscription covers it. |
credit | CreditMeta or null | No | Cost of the request and your estimated remaining balance. Present only when billable is true. |
page | PageMeta or null | No | Paging state. Present only on a response that lists a page. |
PageMeta
Where a paged list stands after this page.
| Field | Type | Required | Description |
|---|---|---|---|
limit | integer | Yes | Page size actually applied to this request. |
has_next | boolean | Yes | Whether another page follows. |
next_cursor | string or null | Yes | Pass it back unchanged as cursor to get the next page; null once the list is complete. |
PageOut_CalculationChainSearchOut_
| Field | Type | Required | Description |
|---|---|---|---|
items | array of CalculationChainSearchOut | Yes | The records on this page. |
total | integer | Yes | Number of matching records on all pages. |
page | integer | Yes | This page's number, from 1. |
page_size | integer | Yes | Records per page. |