> For the complete documentation index, see [llms.txt](https://8bit-1.gitbook.io/solibrary/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://8bit-1.gitbook.io/solibrary/fetch.md).

# Fetch

Once Inscription Accounts are [initialized](https://developers.metaplex.com/inscription/initialize) their Metadata can be read from chain again. Once data is [written](https://developers.metaplex.com/inscription/write) it can also be read. To fetch inscriptions you also have to use different functions according to the inscription type.

### Fetch inscription Metadata <a href="#fetch-inscription-metadata" id="fetch-inscription-metadata"></a>

Both inscription types use a metadata account. This Account contains for example the `inscriptionRank`, `associatedInscriptions`, `updateAuthorities` and [more](https://mpl-inscription.typedoc.metaplex.com/types/InscriptionMetadata.html). The Metadata can be fetched like so:

Fetch Inscription Metadata

JavaScript

```
import { safeFetchInscriptionMetadataFromSeeds } from '@metaplex-foundation/mpl-inscription'

const inscriptionMetadataAccount = await safeFetchInscriptionMetadataFromSeeds(
  umi,
  {
    inscriptionAccount: inscriptionAccount.publicKey,
  }
)

console.log(inscriptionMetadataAccount)
```

### Fetch mint inscription <a href="#fetch-mint-inscription" id="fetch-mint-inscription"></a>

To fetch the deserialized mint inscription you can use `safeFetchMintInscriptionFromSeeds` like so:

Fetch Mint Inscription

JavaScript

```
import { fetchInscription, safeFetchMintInscriptionFromSeeds, safeFetchInscriptionMetadataFromSeeds } from '@metaplex-foundation/mpl-inscription'

const mintInscription = await safeFetchMintInscriptionFromSeeds(umi, {
  mint,
})

const inscriptionMetadataAccount = await safeFetchInscriptionMetadataFromSeeds(
  umi,
  {
    inscriptionAccount: inscriptionAccount.publicKey,
  }
)

const associatedInscriptionAccount = findAssociatedInscriptionPda(umi, {
  associated_tag: inscriptionMetadataAccount.associatedInscriptions[0].tag,
  inscriptionMetadataAccount.publicKey,
})
const imageData = await fetchInscription(umi, associatedInscriptionAccount[0])
```

### Fetch data inscription <a href="#fetch-data-inscription" id="fetch-data-inscription"></a>

To read Inscription Data that is not attached to NFTs a different function is used:

Fetch Inscription

JavaScript

```
import { fetchInscription } from '@metaplex-foundation/mpl-inscription'

const inscription = fetchInscription(umi, inscriptionAddress)
```

### Fetch current Inscription count <a href="#fetch-current-inscription-count" id="fetch-current-inscription-count"></a>

The current total inscription count can be fetched like so:

Fetch current Inscription count

JavaScript

```
import {
  fetchAllInscriptionShard,
  findInscriptionShardPda,
} from '@metaplex-foundation/mpl-inscription'

const shardKeys: Pda[]
for (let shardNumber = 0; shardNumber < 32; shardNumber += 1) {
  shardKeys.push(findInscriptionShardPda(umi, { shardNumber }))
}

const shards = await fetchAllInscriptionShard(umi, shardKeys)
let numInscriptions = 0
shards.forEach((shard) => {
  const rank = 32 * Number(shard.count) + shard.shardNumber
  numInscriptions = Math.max(numInscriptions, rank)
})

console.log(`Currently there are ${numInscriptions} Metaplex Inscriptions`)
```
