# Basic queries

In this section, you'll make some simple and basic queries:

> You can try this directly in our [**alphanet indexer's playground**](https://indexer-alphanet.ternoa.dev/) or our [**mainnet indexer's playground**](https://indexer-mainnet.ternoa.network/)

### Query owned NFTs on the nftEntities

```graphql
query {
  nftEntities(
    first: 5,
    filter: {
      owner: { equalTo: "5CDGXH8Q9DzD3TnATTG6qm6f4yR1kbECBGUmh2XbEBQ8Jfa5" }
    }
  ) {
    totalCount
     nodes {
      nftId
      owner
      creator
      collectionId
      offchainData
    }
  }
}
```

To access the node information you want to display, you can look directly into the docs panel on the right side of the playground :

<figure><img src="/files/gY4W3V05RVehQ1TDDyut" alt=""><figcaption></figcaption></figure>

### Query created NFTs on the nftEntities

```graphql
query {
  nftEntities(
    first: 5,
    filter: {
      creator: { equalTo: "5CDGXH8Q9DzD3TnATTG6qm6f4yR1kbECBGUmh2XbEBQ8Jfa5" }
    }
  ) {
    totalCount
     nodes {
      nftId
      owner
      creator
      collectionId
      offchainData
    }
  }
}
```

### Let's query the 10 first listed NFTs on the nftEntities

```graphql
query {
  nftEntities(first: 10, filter: { listedForSale: { equalTo: true } }) {
    totalCount
    nodes {
      nftId
      listedForSale
      owner
      timestampList
      price
      marketplaceId
    }
  }
}
```

### Query marketplaces on the marketplaceEntities

```graphql
query {
  marketplaceEntities{
    totalCount
    nodes {
      marketplaceId
      offchainData
      kind
      owner
      commissionFeeType
      commissionFee
      commissionFeeRounded
      listingFeeType
      listingFee
      listingFeeRounded
    }
  }
}
```

### Query a specific NFT on the nftEntity

```graphql
query {
  nftEntity(id: "100") {
    nftId
    owner
    creator
    collectionId
    offchainData
  }
}
```

### Query specific NFT history on the nftOperationEntities

```graphql
query {
  nftOperationEntities(
    orderBy: TIMESTAMP_DESC
    filter: { nftId: { equalTo: "100" } }
  ) {
    totalCount
    nodes {
      nftId
      blockId
      extrinsicId
      typeOfTransaction
      from
      to
      price
      priceRounded
      timestamp
    }
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ternoa.network/build-1/javascript/indexer/global-requests/basic-queries.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
