# Counting specific transaction data in specific smart contract method call

**URL:** <https://community.bitquery.io/t/counting-specific-transaction-data-in-specific-smart-contract-method-call/901>\
**Category:** GraphQL API\
**Tags:** support, closed\
**Created:** [March 12, 2022, 12:01am UTC](https://community.bitquery.io/t/counting-specific-transaction-data-in-specific-smart-contract-method-call/901 "2022-03-12T00:01:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alpdoga](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@alpdoga](https://community.bitquery.io/u/alpdoga)\
**Post date:** [March 12, 2022, 12:01am UTC](https://community.bitquery.io/t/counting-specific-transaction-data-in-specific-smart-contract-method-call/901/1 "2022-03-12T00:01:57Z")

</div>

Bitquery is amazing, just started experimenting around two days ago and got one small issue. Using to query some Avalanche data.

I’m currently using the following code to count calls of a smart contract  
`smartContractAddress: {is: $address}`  
while filtering one specific method  
`smartContractMethod: {is: "a47d9d33"}`

**the whole code looks like this**

```auto
query ($network: EthereumNetwork!, $address: String!, $limit: Int!, $offset: Int!, $from: ISO8601DateTime, $till: ISO8601DateTime) {
  ethereum(network: $network) {
    smartContractCalls(
      options: {desc: "count", limit: $limit, offset: $offset}
      date: {since: $from, till: $till}
      smartContractAddress: {is: $address}
      smartContractMethod: {is: "a47d9d33"}
    ) {
      address: caller {
        address
        annotation
      }
      max_date: maximum(of: date)
      count
      gasValue(calculate: average)
    }
  }
}

```

**and additional data:**

```auto
{
  "limit": 10,
  "offset": 0,
  "network": "avalanche",
  "address": "0x1d34b421a5ede3e300d3b8bcf3be5c6f45971e20",
  "nativeCurrency": "AVAX",
  "from": "2022-02-10",
  "till": "2022-03-11T23:59:59",
  "dateFormat": "%Y-%m-%d"
}

```

How can I “filter” even more?

Example transaction (on Avalanche)  
**0xf17f3fdabd91e2969c52590f7296bf9f2b2eb6f1dc8ba5ff2c8a071ca7c6a77b**

It is possible to filter for the method and count that, however, in this case I need to count by filtering the input data.

The input data in this case is:

 ![decoded](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/860b2f79b5a9a820ce5b46e89e0e5926502c3b2a.png)

The 1 at the end of line [3] is important to count. If there are only zeros in [3] it should not count the call.

Is it possible to dive even further and count or write down the quantity of each of those calls - this info is in [2].

Appreciate any help.

Thank you!

---

<div class="post-metadata">

**Author:** ![aman](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@aman](https://community.bitquery.io/u/aman)\
**Post date:** [March 14, 2022, 4:55am UTC](https://community.bitquery.io/t/counting-specific-transaction-data-in-specific-smart-contract-method-call/901/2 "2022-03-14T04:55:58Z")

</div>

Can you show the data in our explorer

---

<div class="post-metadata">

**Author:** ![alpdoga](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@alpdoga](https://community.bitquery.io/u/alpdoga)\
**Post date:** [March 14, 2022, 8:30am UTC](https://community.bitquery.io/t/counting-specific-transaction-data-in-specific-smart-contract-method-call/901/3 "2022-03-14T08:30:02Z")

</div>

Unfortunately, the query does only count the method calls per day, however, filtering further to the input data would be very useful. How can I add this to the query?

 ![data_in_explorer](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/95464a176b8ba585c0ecc1e74a596a39ab2989b7.png)

Query link: [Count of ALOT orders per day (bitquery.io)](https://graphql.bitquery.io/ide/Count-of-ALOT-orders-per-day)

---

<div class="post-metadata">

**Author:** ![aman](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@aman](https://community.bitquery.io/u/aman)\
**Post date:** [March 14, 2022, 10:19am UTC](https://community.bitquery.io/t/counting-specific-transaction-data-in-specific-smart-contract-method-call/901/4 "2022-03-14T10:19:07Z")

</div>

I do not understand your question

---

<div class="post-metadata">

**Author:** ![alpdoga](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@alpdoga](https://community.bitquery.io/u/alpdoga)\
**Post date:** [March 14, 2022, 10:46am UTC](https://community.bitquery.io/t/counting-specific-transaction-data-in-specific-smart-contract-method-call/901/5 "2022-03-14T10:46:23Z")

</div>

Sorry for my misarticulation.

If you check this transaction: **0xf17f3fdabd91e2969c52590f7296bf9f2b2eb6f1dc8ba5ff2c8a071ca7c6a77b**

You can see that it has input data in this format

 ![decoded](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/860b2f79b5a9a820ce5b46e89e0e5926502c3b2a.png)

How can I change my query in a way that it does not count every call of the method a47d9d33

(as it is done currently with)

```auto
smartContractMethod: {is: "a47d9d33"}

```

but to count every transaction with method a47d9d33 **and** input data tradepaidId is: “0x415641582f555344542e65000000000000000000000000000000000000000000”

I need to differentiate between several calls of this smart contract with this method a47d9d33 using the input data.

---

<div class="post-metadata">

**Author:** ![alpdoga](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@alpdoga](https://community.bitquery.io/u/alpdoga)\
**Post date:** [March 19, 2022, 8:49pm UTC](https://community.bitquery.io/t/counting-specific-transaction-data-in-specific-smart-contract-method-call/901/6 "2022-03-19T20:49:15Z")

</div>

push, maybe someone can help

---

<div class="post-metadata">

**Author:** ![aman](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@aman](https://community.bitquery.io/u/aman)\
**Post date:** [March 22, 2022, 7:14am UTC](https://community.bitquery.io/t/counting-specific-transaction-data-in-specific-smart-contract-method-call/901/7 "2022-03-22T07:14:39Z")

</div>

The argument api usually works, but we are facing some troubles in avalanche in particular. We have reported it to our development team. They will look into it. Here are some examples of arguments api:

1. [Aggregate Smart contract Argument](https://graphql.bitquery.io/ide/ODMyp61v3P)
2. [Filtered arguments](https://graphql.bitquery.io/ide/Elg6ViYPcN)
3. [Transaction Arguments](https://graphql.bitquery.io/ide/mIkDPTbF8X)
