# Query Points and Billing infromation APIs

**URL:** <https://community.bitquery.io/t/query-points-and-billing-infromation-apis/1156>\
**Category:** GraphQL Tutorials\
**Created:** [August 5, 2022, 6:20am UTC](https://community.bitquery.io/t/query-points-and-billing-infromation-apis/1156 "2022-08-05T06:20:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitquery-support](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bitquery-support](https://community.bitquery.io/u/bitquery-support)\
**Post date:** [August 5, 2022, 6:20am UTC](https://community.bitquery.io/t/query-points-and-billing-infromation-apis/1156/1 "2022-08-05T06:20:48Z")

</div>

# Query Points and Billing infromation APIs

> **Table of Contents**
>
> 1. [Get Information About Your API Key With a Query](#get-information-about-your-api-key-with-a-query) 
> 2. [Know How Many Points a Query Consumes for its ID](#know-how-many-points-a-query-consumes-for-its-id)
> 3. [References](#references)

## Get Information About Your API Key With a Query

### We will learn:

- Get details of our API Key
- Get our Billing Day
- Remaining Points
- And other relevant information about our API Key

### Requirements:

- Have an API Key from [Bitquery IDE](https://graphql.bitquery.io/i)

To obtain the details of our API Key we will use the following [query](https://graphql.bitquery.io/ide/Billing-period-info)

```auto
query activePeriodInformation {
  utilities {
    activePeriod (apiKey: "YOUR_API_KEY"){
      pointsRemaining
      points
      isPaid
      isPointsConsumed
      isSpent
      isBlocked
      starts {
        date
      }
      ends {
        date
      }
      billingDay
    }
  }
}

```

> We need to replace `YOUR_API_KEY` with our API Key

  

 ![api_details_bitquery](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/415f58b345ea597e25a790fcfc8726768707dfb5.jpeg)

> Yeah, but why do I want to know those details if we can see them on the [Bitquery page](https://graphql.bitquery.io/user/account)?

This could be useful to implement it in the logic of our applications, but what for?  
Imagine that you have 100k points and your application consumes an average of 10k points per day, implementing something like this you can keep an internal metric (as well as know when to make different queries).

## Know How Many Points a Query Consumes for its ID

### We will learn:

- Know how much a query consumes

### Requirements:

- A Query ID

With the following [query](https://graphql.bitquery.io/ide/Get-points-info-for-query-id) we will be able to know how much a query consumes with its ID

```auto
query activePeriodInformation {
  utilities {
    metrics(queryId: "QUERY-ID") {
      points
    }
  }
}

```

> We need to replace `QUERY-ID` with our Query ID

  

 ![know-query-points](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/9d3e39427b1ca6e305893a511bd49965ba7c44d7.png)

## References

If you have any specific problem, maybe these links will help you:

[Bitquery Official Page](https://bitquery.io/)

[Bitquery Forum](https://community.bitquery.io/)

[Bitquery on Telegram](https://t.me/Bloxy_info)
