Explore ETH through dfuse

Try our API from your browser

The best way to get a taste of what you can do with dfuse is to try it out!

GraphiQL is a tool that allows writing and running graphQL queries from your browser. It is offered on every dfuse endpoint with a valid anonymous JWT for convenience. It also offers an access to the documented GraphQL schema on a side pane, as well as a very useful auto-completion feature (simply place your cursor somewhere and press Ctrl+<Space> to see completion possibilities.)

GraphiQL screenshot

Examples

Fetch

  • Get a transaction:

    {
      transaction(hash: "0x1f73b43dc9c48cc131a931fac7095de9e5eba0c5184ec0c5c5f1f32efa2a6bab") {
        from
        to
        gasUsed gasPrice(encoding: ETHER)
      }
    }

  • Get a block:

    {
      blockByNumber(number: 7280000) {
        hash
        header { parentHash difficulty }
      }
    }

Stream

  • Stream blocks as they come in (every ~12s)

    subscription{
      blocks(lowBlockNum:-1){
        node{
          number hash
          transactionTraces{ edges{ node{ hash } } }
          uncles{ hash }
        }
      }
    }

  • Stream transactions based on a search query

       subscription {
         searchTransactions( indexName: CALLS, lowBlockNum: -1,
                            query: "-value:0") {
            undo cursor
            node {
              block{ number }
              matchingCalls { from to value(encoding: ETHER) }
            }
          }
        }

Search queries (either streaming through a GraphQL subscription or paginated through a GraphQL query) are constructed using dfuse Search Query Language. See the Ethereum Search Terms Reference for a complete list of accepted terms.

You can try those search queries directly in the https://ethq.app search bar, or in the “query” parameter of the searchTransaction method in GraphiQL.

dfuse offers two (2) distinct indexes to match transactions: CALLS and LOGS

  • To search for transactions which contain an ETHER transfer (non-zero) from or to a specific address

# with indexName = CALLS
-value:0 (to:0x32be343b94f860124dc4fee278fdcbd38c102d88 OR
          from:0x32be343b94f860124dc4fee278fdcbd38c102d88)
Try it on GraphiQL Try it on ETHQ

  • To search for transactions which contain a transfer(address, uint256) method on a known ERC-20 token contract (the actual value transferred has to be decoded from the ‘data’ in the logs)

# with indexName = CALLS
method:'transfer(address,uint256)' to:0xdac17f958d2ee523a2206206994597c13d831ec7
Try it on GraphiQL Try it on ETHQ

Note

The method can also be specified with the 8-bytes prefix of its keccak hash, ex: method:a9059cbb
  • To search for transactions signed by a specific address, use:

# with indexName = CALLS
signer:0x59a5208B32e627891C389EbafC644145224006E8
Try it on GraphiQL Try it on ETHQ

  • To search for transactions that provided a given input to a contract, use:

# with indexName = CALLS
input.0:0x84ae8708798c74ef8d00f540c4012963955106ff to:0x06012c8cf97bead5deae237070f9587f8e7a266d
Try it on GraphiQL Try it on ETHQ

  • To search for transactions with an EVM call that tweaked storage for a given key in a contract (that’s very specific!):

# with indexName = CALLS
to:0xa327075af2a223a1c83a36ada1126afe7430f955 storageChange:0x3
Try it on GraphiQL

  • To search for transactions that match a specific topic in the logs of an EVM call

# with indexName = LOGS
topic.0:0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
Try it on GraphiQL

  • To search for transactions that match a specific data chunk (32-bytes) in the logs of an EVM call (that’s very specific!):

# with indexName = LOGS
data.0:0x0000000000000000000000004a220e6096b25eadb88358cb44068a3248254675
Try it on GraphiQL

Learn more