Skip to content

Commit

Permalink
Add a summary for the public JSON API
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexITC committed Dec 22, 2018
1 parent 7592e06 commit 73943f7
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ The web-ui is the frontend application that interacts with the `server` project
## infra
The infra project contains all stuff related to the required infrastructure, like deployment steps and hopefully deployment scripts (TODO).

# Public JSON API
See the [api_docs](api_docs.md).

# Contributing
We are happy to accept contributions, please read the [CONTRIBUTING.md](CONTRIBUTING.md) file to see our rules.
57 changes: 57 additions & 0 deletions api_docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Explorer API
Disclaimer: This documentation might have issues, the best way to get understand how is the API used is to use the developer tools from your favorite browser while browsing the explorer website.

All endpoints are accessible at `https://xsnexplorer.io/api/xsn/`, for accessing the `/health` endpoint, load `https://xsnexplorer.io/api/xsn/health`


## Statistics

## GET /stats

Retrieves statistics: `curl https://xsnexplorer.io/api/xsn/stats`


## Transactions

### GET /transactions/:txid

Retrieves a transaction by id: `curl https://xsnexplorer.io/api/xsn/transactions/efa97e3f55d3722df678986c7c275d63e8a2aa169b164c932c1f6dd8755356ad`

### GET /transactions/:txid/raw
Retrieves the raw transaction by id: `curl https://xsnexplorer.io/api/xsn/stats`



## Addresses

### GET /addresses/:address
Retrieves info about an address: `curl https://xsnexplorer.io/api/xsn/addresses/XvoBWMPo1NFstmCCTWZQ8w4BcmHXddNLxX`

### GET /addresses/:address/transactions

Retrieves the transactions for an address: `curl "https://xsnexplorer.io/api/xsn/addresses/XvoBWMPo1NFstmCCTWZQ8w4BcmHXddNLxX/transactions?offset=0&limit=10&orderBy=time:desc"`

Note: ordering and pagination are optional.



## Blocks

### GET /blocks

Retrieves the latest blocks: `curl https://xsnexplorer.io/api/xsn/blocks`

### GET /blocks/:query
Retrieves a block: `curl https://xsnexplorer.io/api/xsn/blocks/20`

Note: `:query` could be a blockhash or block height.

### GET /blocks/:query/raw
Retrieves a raw block: `curl https://xsnexplorer.io/api/xsn/blocks/20/raw`

Note: `:query` could be a blockhash or block height.

### GET /blocks/:blockhash/transactions
Retrieves the transactions on the given block: `curl "https://xsnexplorer.io/api/xsn/blocks/31791420aa1d096c84317a3ba40f448ee5fe5a1c6f8c21a02f026e5135b624b4/transactions?offset=0&limit=5&orderBy=time:desc"`

Note: ordering and pagination are optional.

0 comments on commit 73943f7

Please sign in to comment.