General API information

  • We are happy to offer you our comprehensive API for your own app building. If you need more data, please contact support at terracoin.io
  • Data returned is JSON
  • Units are given in brackets []
  • Please be polite to our API and avoid hammering. Limit requests to max. 1 request each 30 seconds.
  • We recommend to integrate a QR code scanner into your app and tell users to scan their API key from "Account settings" -> "Mobile app"

Download Terracoin image pack to enhance your app with high quality Terraacoin logo and background:

Overview

  1. Public API: general Terracoin Services information
  2. Private user API "getappdata": get detailed information about masternode status and earnings
  3. Private user API "setappdata": add and remove masternodes / verify masternode ownership
  4. Budget proposals: budget proposal description and comments (TBIN)

Public Api

General public Terracoin Services information.

https://services.terracoin.io/api/v1/public
Group Values
general [array]
  • consensus_blockheight: current blockheight determined by > 10 Terracoin wallets [integer]
  • consensus_version: current Terracoin wallet version [integer]
  • consensus_protocolversion: current Terracoin wallet protocolversion [integer]
  • all_user: amount of all Terracoin Services users [integer]
  • active_user: amount of Terracoin Services users with at least one registered masternode [integer]
  • registered_masternodes: amount of registered masternodes [integer]
  • registered_masternodes_verified: amount of registered masternodes with verified ownership [integer]
exchange_rates [array]
  • trc_usd: TRC to USD exchange rate [double, USD]
  • btc_usd: BTC to USD exchange rate [double, USD]
  • btc_trc: BTC to TRC exchange rate [double, BTC]
https://services.terracoin.io/api/v1/top200
Group Values
updated [timestamp]
  • timestamp of when the data was last updated
list [array]
  • address: TRC address [string]
  • balance: Current balance in the address [double, TRC]
  • txs: Total transaction count [integer]
  • firsttx: Timestamp of the first TX [timestamp]
  • lasttx: Timestamp of the last TX [timestamp]

Private user Api (getappdata)

The Terracoin Services API provides you with all data you need for your app in only one request.

https://services.terracoin.io/api/v1/getappdata?api_key=<user_api_key>
Group Values
general [array]
  • consensus_blockheight: current blockheight determined by > 10 Terracoin wallets [integer]
  • consensus_version: current Terracoin wallet version [integer]
  • consensus_protocolversion: current Terracoin wallet protocolversion [integer]
  • all_user: amount of all Terracoin Services users [integer]
  • active_user: amount of Terracoin Services users with at leat one registeren masternode [integer]
  • registered_masternodes: amount of registered masternodes [integer]
  • registered_masternodes_verified: amount of registered masternodes with verified ownership [integer]
exchange_rates [array]
  • trc_usd: TRC to USD exchange rate [double, USD]
  • btc_usd: BTC to USD exchange rate [double, USD]
  • btc_trc: BTC to TRC exchange rate [double, BTC]
user [array]
  • username: Terracoin Services username
  • masternodes_total: total amount of masternodes registered by this user [integer]
  • masternodes_ok: amount of masternodes with status ok [integer]
  • masternodes_warning: amount of masternodes with status warning [integer]
  • masternodes_error: amount of masternodes with status error [integer]
  • remote_data: users can download the terracoinservices-updater monitoring script to activly push blockheight, version and protocolversion to Terracoin Services [enabled, disabled]
  • remote_lastupdate: timestamp of the last data push received from the terracoinservices-updater script [datetime]
earnings [array]
  • balance: sum of all masternode wallet balances [double, TRC]
  • balance_overhead: sum of all masternode wallet balances subtracted by the 5000 TRC deposits [double, TRC]
  • lifetime_payments: amount of payments recieved by all user masternodes [integer]
  • lifetime_earnings: sum of all earnings generated with all user masternodes [double, TRC]
  • payments_today: amount of payments recieved since today user midnight [integer]
  • earnings_today: TRC earnings generated since today user midnight [double, TRC]
  • payments_24h: amount of payments recieved within last 24h [integer]
  • earnings_24h: TRC earnings generated within the last 24h [double, TRC]
  • payments_7d: amount of payments recieved within last 7d [integer]
  • earnings_7d: TRC earnings generated within the last 7d [double, TRC]
  • payments_30d: amount of payments recieved within last 30d [integer]
  • earnings_30d: TRC earnings generated within the last 30dh [double, TRC]
earnings_daily [array]

(last 60 days)
  • day: date of the day [datetime]
  • earnings: sum of all user masternode earnings on this day [double, TRC]
  • payments: amount of payments recieved by all user masternodes [integer]
masternodes [array]
  • name: user given name of masternode [max. 50 chars]
  • ip: masternode ip and port [xxx.xxx.xxx.xxx:9999]
  • status: masternode monitoring status [ok, warning, error, checking]
  • status_human: detailed explanation of the status/problem [max. 250 chars, may contain <br> to indicate a newline]
  • ownership: status of masternode ownership verification [verified, unverified]
  • balance: balance of the masternode address [double, TRC]
  • balance_overhead: balance of the masternode address subtracted by the 5000 TRC deposits [double, TRC]
  • payments_today: amount of payments recieved since today user midnight [integer]
  • earnings_today: TRC earnings generated since today user midnight [double, TRC]
  • payments_24h: amount of payments recieved within last 24h [integer]
  • earnings_24h: TRC earnings generated within the last 24h [double, TRC]
  • payments_7d: amount of payments recieved within last 7d [integer]
  • earnings_7d: TRC earnings generated within the last 7d [double, TRC]
  • payments_30d: amount of payments recieved within last 30d [integer]
  • earnings_30d: TRC earnings generated within the last 30dh [double, TRC]
  • lastpayment: timestamp of the last payment this masternode has received [datetime]
  • lastpayment_human: human text of the last payment timestamp [x seconds/minutes/hours/days ago]
  • protocolversion: protocol version of the masternode derived from daemon masternode list [integer]

The following data is only available, if user setup and enabled remote data pushing (user->remote_data = enabled):

  • remote_lastupdate: timestamp of the last data push received from the terracoinservices-updater script [datetime]
  • remote_blockheight: masternode blockheight pushed by terracoinservices-updater [integer]
  • remote_version: masternode wallet version pushed by terracoinservices-updater [integer]
  • remote_protocolversion: masternode wallet protocol version pushed by terracoinservices-updater [integer]

Private user Api (setappdata)

You can add and remove workers using the setappdata api

https://services.terracoin.io/api/v1/setappdata?api_key=<user_api_key>&do=<do_parameter>
do parameter further parameter response
add_masternode name (user chosen masternode name, max. 50 chars)

address (masternode coin address holding the 5000 TRC)
  • do
  • status [ok, error]
  • message: human description in case of an error
remove_masternode address (masternode coin address holding the 5000 TRC)
  • do
  • status [ok, error]
  • message: human description in case of an error
get_verification_string address (masternode coin address holding the 5000 TRC)
  • do
  • status [ok, error]
  • message: human description in case of an error
  • verification_string: string that has to be signed with private key of the masternode address (wallet signature feature)
verify_ownership address (masternode coin address holding the 5000 TRC)

signature (signature of verification_string / IMPORTANT: signature has to be urlencoded!)

Perform signing using your command line wallet:
terracoin-cli signmessage "MASTERDODE_ADDRESS" "VERIFICATION_STRING"
  • do
  • status [ok, error]
  • message: human description in case of an error

Example: add a masternode
https://services.terracoin.io/api/v1/setappdata?api_key=<user_api_key>&do=add_masternode&name=MN1&address=1JyRcnyYSoNtbmtEWUq9uCZzKHsGhVXWHE

Terracoin budget information network (TBIN)


Check out our separate page covering the budget proposal APIs!