# Case insensitive partial token search

**URL:** <https://community.bitquery.io/t/case-insensitive-partial-token-search/508>\
**Category:** GraphQL API\
**Tags:** closed\
**Created:** [September 28, 2021, 7:36pm UTC](https://community.bitquery.io/t/case-insensitive-partial-token-search/508 "2021-09-28T19:36:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![BJMg](https://avatars.discourse-cdn.com/v4/letter/b/f08c70/32.png) [@BJMg](https://community.bitquery.io/u/BJMg)\
**Post date:** [September 28, 2021, 7:36pm UTC](https://community.bitquery.io/t/case-insensitive-partial-token-search/508/1 "2021-09-28T19:36:58Z")

</div>

Hi.  
I am trying to do a query to find all tokens by a partial match case insensitive match. Sofar I have something like this, but unfortunately it is case sensitive and only for full match. Is there some way to improve it?

```auto
query TokenSearch ($tokenNames: [String!]) {
    ethereum(network: bsc) {
        transfers(
            currency: [{in: $tokenNames}],
            options: {limit: 10, desc: ["count"]}
        ) {
            currency {
                name
                address
                symbol
                tokenType
                decimals
            }
            count(uniq: transfers)
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)\
**Post date:** [September 29, 2021, 3:37am UTC](https://community.bitquery.io/t/case-insensitive-partial-token-search/508/2 "2021-09-29T03:37:42Z")

</div>

The currency values which you can filter with the _currency_ parameter are limited and are indeed, “case sensitive”. Would you be kind enough to share the list of **$tokenNames** that you are querying so that I can understand your doubt in a better way?

---

<div class="post-metadata">

**Author:** ![BJMg](https://avatars.discourse-cdn.com/v4/letter/b/f08c70/32.png) [@BJMg](https://community.bitquery.io/u/BJMg)\
**Post date:** [September 29, 2021, 9:32pm UTC](https://community.bitquery.io/t/case-insensitive-partial-token-search/508/3 "2021-09-29T21:32:28Z")

</div>

Thanks for the answer. $tokenNames can be e.g. [“moon”] then I would expect to find tokens with name or symbol like SafeMoon, MoonMiner, MoonKitty etc.

---

<div class="post-metadata">

**Author:** ![sayon](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sayon](https://community.bitquery.io/u/sayon)\
**Post date:** [September 30, 2021, 3:33pm UTC](https://community.bitquery.io/t/case-insensitive-partial-token-search/508/4 "2021-09-30T15:33:00Z")

</div>

As of now only USDT, BTC and ETH are supported.

---

<div class="post-metadata">

**Author:** ![BJMg](https://avatars.discourse-cdn.com/v4/letter/b/f08c70/32.png) [@BJMg](https://community.bitquery.io/u/BJMg)\
**Post date:** [October 3, 2021, 7:14pm UTC](https://community.bitquery.io/t/case-insensitive-partial-token-search/508/5 "2021-10-03T19:14:28Z")

</div>

That is not really a true. If I try this query

```auto
 {
  ethereum(network: bsc) {
  transfers(
            currency: [{in: "moon"}],
            options: {limit: 10, desc: ["count"]}
        ) {
            currency {
                name
                address
                symbol
                tokenType
                decimals
            }
            count(uniq: transfers)
        }
}
  }

```

I get a following response

```auto
{
  "ethereum": {
    "transfers": [
      {
        "currency": {
          "name": "moon",
          "address": "0x64a756d81c1c21935626038a96f7e92ed1b4ccc0",
          "symbol": "moon",
          "tokenType": "ERC20",
          "decimals": 9
        },
        "count": 623
      },
      {
        "currency": {
          "name": "Binanmoon",
          "address": "0xc96cd1e9bf97d956516fa19a346c3809667d492d",
          "symbol": "moon",
          "tokenType": "ERC20",
          "decimals": 8
        },
        "count": 241
      },
      {
        "currency": {
          "name": "spacexmoon",
          "address": "0xffa635a0f9c61f85d0d954be4ab3641be439037f",
          "symbol": "moon",
          "tokenType": "ERC20",
          "decimals": 9
        },
        "count": 108
      },
      {
        "currency": {
          "name": "moonb",
          "address": "0xf08c68629bdb0d04136bee7b49da7060a0a7e6ce",
          "symbol": "moon",
          "tokenType": "ERC20",
          "decimals": 18
        },
        "count": 37
      },
... and more

```

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [October 12, 2021, 2:24pm UTC](https://community.bitquery.io/t/case-insensitive-partial-token-search/508/6 "2021-10-12T14:24:35Z")

</div>

We also have a search API. May be this help

> **[Balances query with time filter example](https://graphql.bitquery.io/ide/IR4LjH1NuZ)**
>
> Use time or date in before or till selectors

---

<div class="post-metadata">

**Author:** ![BJMg](https://avatars.discourse-cdn.com/v4/letter/b/f08c70/32.png) [@BJMg](https://community.bitquery.io/u/BJMg)\
**Post date:** [October 12, 2021, 8:38pm UTC](https://community.bitquery.io/t/case-insensitive-partial-token-search/508/7 "2021-10-12T20:38:08Z")

</div>

Thanks for the answer @gaurav . I have tried search api. Maybe I am using it wrong, but when I try something like this

```auto
{
  search(string: "MO", network: bsc) {
    network {
      network
    }
    subject {
      ... on Currency {
        symbol
        name
        address
      }
    }
  }
}

```

I get only tokens which has exactly the name or symbol `MO`. I can’t seem to make it work only for partial matches or caseinsensitive. Also in ideal case I would like to be able to sort it, but that is another issue.

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [October 13, 2021, 2:00pm UTC](https://community.bitquery.io/t/case-insensitive-partial-token-search/508/8 "2021-10-13T14:00:43Z")

</div>

Try this

```auto
{
  search(string: "MO%", network: bsc) {
    network {
      network
    }
    subject {
      ... on Currency {
        symbol
        name
        address
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![tjones0808](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tjones0808](https://community.bitquery.io/u/tjones0808)\
**Post date:** [December 9, 2021, 12:23am UTC](https://community.bitquery.io/t/case-insensitive-partial-token-search/508/9 "2021-12-09T00:23:52Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/760255e9d57fc582929fe4a88e39a7f8b5de6253.png)  
this is giving me errors now

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [December 10, 2021, 11:30am UTC](https://community.bitquery.io/t/case-insensitive-partial-token-search/508/10 "2021-12-10T11:30:07Z")

</div>

> [@gaurav](#):
>
> ```auto
> {
> search(string: "MO%", network: bsc) {
> network {
> network
> }
> subject {
> ... on Currency {
> symbol
> name
> address
> }
> }
> }
> }
> 
> ```

It’s working now, please check. Search API was having some issues. Now it’s fixed.
