DEV Community 👩‍💻👨‍💻

Cover image for A Simple API for Web3 Data
Sort
Sort

Posted on

A Simple API for Web3 Data

It should be easy to query Web3 data, all of it, anything on the blockchain. Despite the blockchain's openness, it's still extremely hard to decode and use blockchain data.

Introducing a Simple API for Web3 Data

Today we're releasing the Alpha version of a new API for accessing data on the Ethereum blockchain.

  1. Access a fully decoded transaction including logs and function information
GET https://api.sort.xyz/v0/transaction/0x4a4101abb79d0e6d8d09dac5f1d2312ef713f20b1101eefcd395a040985eda28
Enter fullscreen mode Exit fullscreen mode
  1. Access the latest transactions for a contract address
POST https://api.sort.xyz/v0/transaction/
{
  "contract_address" : "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
  "limit": 10
}
Enter fullscreen mode Exit fullscreen mode
  1. Access NFT data for a contract
POST https://api.sort.xyz/v0/transaction/
{
  "nft_address" : "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
  "nft_event" : "sale",
  "limit": 10
}
Enter fullscreen mode Exit fullscreen mode
  1. Aggregate coin sales data to power a real-time sales chart
POST https://api.sort.xyz/v0/transaction/
{
  "contract_address" : "0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f",
  "coin_buy" : "0x0ab87046fBb341D058F17CBC4c1133F25a20a52f",
  "aggregate" : { "op" : "sum", "by" : "hour", "field" : "coin_transaction.from.amount_shifted" },
  "limit" : 24,
  "timestamp" : "gte:2021-03-22"
}
Enter fullscreen mode Exit fullscreen mode

An Open API

The Sort Analytics API is free, rate limits and other information are listed here.

As of April 13, 2022, the API is considered version 0 (Public Alpha), we are still finding and fixing occasional bugs. Please relay any feedback to the team via our public discord.

Powering Dashboards, Applications, Charts, and More

Use the API to power anything in your application that needs Web3 data. Since the API is open and doesn't require API keys, no server side code is needed, all API calls can be made directly by the client.

Continue by

Top comments (2)

Collapse
 
andypiper profile image
Andy Piper

What about search - can I search for anything on the blockchain? Or do I always need to know the transaction ID? (I'm new to this area)

Collapse
 
sort_xyz profile image
Sort

Good question! We're planning to add search by contract name, other than that, search won't be very interesting since each transaction is composed of a function call/logs (not a lot of text). Searching for a function name could also be a possibility. Hopefully that helps!

Top 7 Badge

Earn our Top 7 Badge!

Write a post that gets featured in our weekly "must-reads" and you can earn this badge for your profile. 😎