Developer APIs

Introduction


The Testnet LibExplorer Developer APIs are provided as a free community service and without warranty for the Libra Blockchain. As the current network is still in the TESTNET phase, expect the API end-points and data to change over time. Also expect frequent network testnet resets as the network continues to evolve.

There is a (soft) limit of 5 API calls/sec/ip. Both GET/POST requests are supported for all endpoints with a maximum return limit of 1000 records per api call. If you have any questions or suggestions please feel free to get in touch with us.

Version

Get Version By Number

                                        https://api-test.libexplorer.com/api?module=version&action=getversion&version=1                                        
                                
(Note: status: 0 = Success, 1 = Fail. (Returns up to a maximum of the last 10000 transactions only))

Statistics

Get Total Supply of Libra

                                        https://api-test.libexplorer.com/api?module=stats&action=librasupply                                        
                                
(Result returned in microlibra, to get value in LIB divide resultAbove/1000000)

Faucet

Get Libra coins

                                        https://api-test.libexplorer.com/api?module=faucet&action=getfaucet&amount=1000000&address=d1ecca696749316a1ebe71ecee2012ae004cd4427d0a043fcf700689924309b2                                        
                                
(Restricted to a maximum of 100 Lib per request. (Amount in microlibra) Note: Testnet Network coins have NO actual monetary value)

Web Socket (Experimental - Subject to change)


The Testnet LibExplorer exposes several data streams over standard WebSocket connections, which can be consumed by modern web browsers and server side WebSocket Libraries

To subscribe module messages from server, client shoud send subcription message to the server.

WebSocket URL

wss://libexplorer.com/wshandler

Subscribe Latest Version

{"event": "subscribe", "module": "version"}

Subscribe Total Supply of Libra

{"event": "subscribe", "module": "stats", "action": "librasupply"}

Subscribe Libra Balance for Address

{"event": "subscribe", "module": "account", "action": "balance", "address":"your address"}

Subscribe Transaction for Address

{"event": "subscribe", "module": "transaction", "action": "txlist", "address":"your address"}