> For the complete documentation index, see [llms.txt](https://devs.peerplays.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devs.peerplays.com/peerplays-api-libraries/python-peerplays/nft-api.md).

# NFT API

## Operations

### Create NFT Meta

```
p.nft_metadata_create(
    owner_account_id_or_name,        # owner of nft meta
    name,                            # nft meta name
    symbol,                          # nft symbol
    base_uri,                        # nft uri
    is_transferable=True,
    is_sellable=True,
    )
```

For example

```
p.nft_metadata_create("1.2.7", self.nameMetadata, self.nameMetadata, self.nameMetadata, revenue_partner="1.2.8", revenue_split=300, is_sellable=False, is_transferable=False)
```

### Update NFT Meta

```
p.nft_metadata_update(
    owner_account_id_or_name,
    nft_metadata_id,
    name,
    symbol,
    base_uri,
    is_transferable=True,
    is_sellable=True,
    )
```

For example

```
p.nft_metadata_update("1.2.7", "1.30.11", self.nameMetadata + "m", self.nameMetadata + "m", self.nameMetadata + "m", "1.2.9", 400, True, True)
```

### Mint NFT

```
p.nft_mint(
    metadata_owner_account_id_or_name,
    metadata_id, 
    owner_account_id_or_name,
    approved_account_id_or_name,
    approved_operators,                     # list of operators
    token_uri,
    )
```

For example

```
p.nft_mint("1.2.7", "1.30.11", "1.2.7", "1.2.7", "1.2.7", self.nameNft)
```

### Transfer NFT

```
p.nft_safe_transfer_from(
    operator_,                # operator account name or id
    from_,
    to_,
    token_id,
    data,                     # notes as string
    )
```

For example

```
p.nft_safe_transfer_from("1.2.7", "1.2.7", "1.2.9", "1.31.5", "whatever")
```

### Approve Control over NFT

```
def nft_approve(
    operator_,
    approved,         # approved account id or name
    token_id,
    )
```

For example

```
p.nft_approve("1.2.9", "1.2.8", "1.31.5")
```

### Approve for all the tokens owned

```
def nft_set_approval_for_all(
    owner,
    operator_,
    approved,
    )
```

For example

```
p.nft_set_approval_for_all("1.2.7", "1.2.10", True)
```

### Info calls

`p.rpc.nft_get_balance(owner)`

`p.rpc.nft_owner_of(token_id)`

`p.rpc.nft_get_approved(token_id)`

`p.rpc.nft_is_approved_for_all(owner, operator)`

`p.rpc.nft_get_name(nft_metadata_id)`

`p.rpc.nft_get_symbol(nft_metadata_id)`

`p.rpc.nft_get_token_uri(token_id)`

`p.rpc.nft_get_total_supply(nft_metadata_id)`

`p.rpc.nft_token_by_index(nft_metadata_id, token_idx)`

`p.rpc.nft_token_of_owner_by_index(nft_metadata_id, owner, token_idx)`

`p.rpc.nft_get_all_tokens()`

`p.rpc.nft_get_tokens_by_owner(owner)`

### Additional Info

For examples, refer to `tests/test_nft.py`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://devs.peerplays.com/peerplays-api-libraries/python-peerplays/nft-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
