NFT REST

class kraken.nft.Market(key: str = '', secret: str = '', url: str = '')

Bases: KrakenNFTBaseAPI

Class that implements the Kraken NFT Market client. Can be used to access the Kraken NFT market data.

Please note that these API endpoints are new and still under development at Kraken. So the behavior and parameters may change unexpectedly. Please open an issue at https://github.com/btschwertfeger/python-kraken-sdk for any issues that can be addressed within this package.

Parameters:
  • key (str, optional) – Spot API public key (default: "")

  • secret (str, optional) – Spot API secret key (default: "")

NFT Market: Create the market client
1>>> from kraken.nft import Market
2>>> market = Market() # unauthenticated
3>>> auth_market = Market(key="api-key", secret="secret-key") # authenticated
NFT Market: List Blockchains
1>>> from kraken.nft import Market
2>>> with Market() as market:
3...     print(market.list_blockchains())
get_auctions(status: str, filter_: str | None = None, *, extra_params: dict | None = None) dict

List the available NFT auctions

Parameters:
  • status (str) – The current status of the auction

  • filter (str, optional) – Filter for auctions

NFT Market: Get Auctions
1>>> from kraken.nft import Market
2>>> market = Market()
3>>> market.get_auctions(
4...     status="open"
5...     filter_="nft_id[]=NTN63WS-PBAV3-FQDQDG"
6... )
get_collection(collection_id: str, currency: str | None = None, *, extra_params: dict | None = None) dict

Get an NFT collection by ID

Parameters:
  • collection_id (str) – The Collection ID

  • currency (Optional[str], optional) – Fiat currency to display values, defaults to None

NFT Market: Get NFT Collection
1>>> from kraken.nft import Market
2>>> market = Market()
3>>> market.get_collection(
4...     collection_id="NCQNABO-XYCA7-JMMSDF", currency="USD"
5... )
get_creator(creator_id: str, *, extra_params: dict | None = None) dict

Retrieve information about a specific NFT creator

Parameters:

creator_id (str) – The ID of the creator

NFT Market: Get Creator
1>>> from kraken.nft import Market
2>>> market = Market()
3>>> market.get_creator(creator_id="NA7NELE-FOQFZ-ODWOTV")
get_nft(nft_id: str, currency: str | None = None, *, extra_params: dict | None = None) dict

Get an NFT by ID

Parameters:
  • nft_id (str) – The ID of the NFT

  • currency (Optional[str], optional) – Fiat currency for representing prices, defaults to None

NFT Market: Get a specific NFT
 1>>> from kraken.nft import Market
 2>>> market = Market()
 3>>> market.get_nft(nft_id="NT4GUCU-SIJE2-YSQQG2")
 4{
 5    "nft": {
 6        "id": "NT4GUCU-SIJE2-YSQQG2",
 7        "name": "#3210 Williams Racing Collectibles+ Grid Pass",
 8        "description": "Grants access to a community of Williams Racing super-fans.",
 9        "max_count": 1,
10        "external_url": None,
11        "image": {
12            "kind": "Main",
13            "media": {
14                "url": "https://assets-dynamic.kraken.com/media1/40c8fa182f98e6e77072df3ac8fe053e9e2ff064f3f0a470346bb7de0613c762.png",
15                "media_type": "image/png",
16                "size": 4334294
17            }
18        },
19        "media": [...],
20        ...
21    },
22    ...
23}
get_nft_provenance(nft_id: str, page: int = 1, per_page: int = 5, currency: str | None = None, *, extra_params: dict | None = None) dict

Retrieve the historical ownership of an NFT

Parameters:
  • nft_id (str) – The NFT ID

  • page (int, optional) – Start page, defaults to 1

  • per_page (int, optional) – Items per page, defaults to 5

  • currency (str, optional) – The currency used for displaying values, defaults to None

NFT Market: Get historical NFT ownership
1>>> from kraken.nft import Market
2>>> market = Market()
3>>> market.list_nfts(
4...     nft_id="NT4GUCU-SIJE2-YSQQG2",
5... )
get_nft_quotes(filter_: str, count: int | None = None, *, extra_params: dict | None = None) dict

List the available NFT quotes

Parameters:
  • filter (str) – Apply specific filters

  • count (int, optional) – Number of items to return

NFT Market: Get Quotes
1>>> from kraken.nft import Market
2>>> market = Market()
3>>> market.get_nft_quotes(
4...     filter_="nft_id[]=NT4GUCU-SIJE2-YSQQG2",
5...     count=2
6... )
get_offers(nft_id: str, *, extra_params: dict | None = None) dict

List the available NFT offers

Parameters:

nft_id (str) – The ID of the NFT

NFT Market: Get Offers
1>>> from kraken.nft import Market
2>>> market = Market()
3>>> market.get_offers(nft_id="NT4GUCU-SIJE2-YSQQG2")
list_blockchains(*, extra_params: dict | None = None) dict

List the available blockchains

NFT Market: List Blockchains
1>>> from kraken.nft import Market
2>>> market = Market()
3>>> market.list_blockchains()
list_collections(page_size: int, currency: str | None = None, cursor: str | None = None, filter_: str | None = None, sort: str | None = None, *, extra_params: dict | None = None) dict

List available NFT collections

Parameters:
  • page_size (int) – Page size

  • currency (Optional[str], optional) – Fiat currency to display values, defaults to None

  • cursor (Optional[str], optional) – Cursor token received by last request, defaults to None

  • filter (Optional[str], optional) – Apply filter, defaults to None

  • sort (Optional[str], optional) – Define sorting, defaults to None

NFT Market: List NFT Collections
1>>> from kraken.nft import Market
2>>> market = Market()
3>>> market.list_collections(
4...         page_size=1,
5...         currency="USD",
6...         filter_="filter[search]=Williams",
7...         sort="MostRelevant",
8... )
list_creators(page_size: int, currency: str | None = None, cursor: str | None = None, filter_: str | None = None, sort: str | None = None, *, extra_params: dict | None = None) dict

List and filter for NFT creators

Parameters:
  • page_size (int) – Page size

  • currency (Optional[str], optional) – Fiat currency to display values, defaults to None

  • cursor (Optional[str], optional) – Cursor token received by last request, defaults to None

  • filter (Optional[str], optional) – Apply filter, defaults to None

  • sort (Optional[str], optional) – Define sorting, defaults to None

NFT Market: Get Creators
1>>> from kraken.nft import Market
2>>> market = Market()
3>>> market.list_creators(
4...         page_size=1,
5...         currency="USD",
6...         filter_="filter[collection_search]=Williams",
7...         sort="MostRelevant",
8... )
list_nfts(page_size: int, cursor: str | None = None, filter_: str | None = None, sort: str | None = None, *, extra_params: dict | None = None) dict

Filter the database for NFTs.

Parameters:
  • page_size (int) – Number of items on a single page

  • cursor (Optional[str], optional) – Cursor token retrieved by a previous request, defaults to None

  • filter (Optional[str], optional) – Filter by NFT attributes, defaults to None

  • sort (Optional[str], optional) – Sort the results, defaults to None

NFT Market: List and filter available NFTs
1>>> from kraken.nft import Market
2>>> market = Market()
3>>> market.list_nfts(
4...     page_size=1,
5...     filter_="filter[collection_id]=NCQNABO-XYCA7-JMMSDF"
6... )
property return_unique_id: str

Returns a unique uuid string

Returns:

uuid

Return type:

str

class kraken.nft.Trade(key: str = '', secret: str = '', url: str = '')

Bases: KrakenNFTBaseAPI

Class that implements the Kraken NFT Trade client. Can be used to access the Kraken NFT market data.

Please note that these API endpoints are new and still under development at Kraken. So the behavior and parameters may change unexpectedly. Please open an issue at https://github.com/btschwertfeger/python-kraken-sdk for any issues that can be addressed within this package.

Parameters:
  • key (str, optional) – Spot API public key (default: "")

  • secret (str, optional) – Spot API secret key (default: "")

NFT Trade: Create the Trade client
1>>> from kraken.nft import Trade
2>>> trade = Trade() # unauthenticated
3>>> auth_trade = Trade(key="api-key", secret="secret-key") # authenticated
NFT Trade:
1>>> from kraken.nft import Trade
2>>> with Trade(key="api-key", secret="secret-key") as trade:
3...     print(trade.)
accept_offer(offer_id: str, otp: str | None = None, *, extra_params: dict | None = None) dict

Accept a specific NFT offer.

Parameters:
  • offer_id (str) – The related offer ID

  • otp (Optional[str], optional) – One time password, defaults to None

NFT Trade: Create Counter Offer
1>>> from kraken.nft import Trade
2>>> trade = Trade()
3>>> trade.accept_offer(offer_id="ONQYPLG-OFARL-35RBGO)
cancel_auction(auction_ids: list[str], otp: str | None = None, *, extra_params: dict | None = None) dict

Cancel an existing auction owned by the user

Parameters:
  • auction_id (list[str]) – IDs referencing the auctions to cancel

  • otp (Optional[str], optional) – One time password, defaults to None

NFT Trade: Cancel Auction
1>>> from kraken.nft import Trade
2>>> trade = Trade()
3>>> trade.cancel_auction(auction_ids=["AT2POJ-4CH3O-4TH6JH"])
counter_offer(currency: str, ask_price: str | int, offer_id: str, expire_time: int | None = None, otp: str | None = None, *, extra_params: dict | None = None) dict

Create a counter offer for an existing offer.

Parameters:
  • currency (str) – The currency to pay with

  • ask_price (str | int) – The counter offer ask price

  • offer_id (str) – The related offer ID

  • expire_time (Optional[int], optional) – Expire time for that counter, defaults to None

  • otp (Optional[str], optional) – One time password, defaults to None

NFT Trade: Create Counter Offer
1>>> from kraken.nft import Trade
2>>> trade = Trade()
3>>> trade.counter_offer(
4...    currency="MATIC",
5...    ask_price=1,
6...    offer_id="ONQYPLG-OFARL-35RBGO",
7... )
create_auction(auction_currency: str, auction_params: dict, auction_type: str, nft_id: list[str], offer_id: str | None = None, otp: str | None = None, start_time: int | None = None, *, extra_params: dict | None = None) dict

Create an NFT auction for the user owned NFTs.

Parameters:
  • auction_currency (str) – The currency code

  • auction_params (dict) – Custom parameters set for this auction

  • auction_type (str) – The type of auction

  • nft_id (list[str]) – List of NFT IDs to put in auction

  • offer_id (Optional[str], optional) – Optional offer ID, defaults to None

  • otp (Optional[str], optional) – One time password, defaults to None

  • start_time (Optional[int], optional) – Custom start time of that auction, defaults to None

NFT Trade: Create Auction
1>>> from kraken.nft import Trade
2>>> trade = Trade()
3>>> trade.create_auction(
4...     auction_currency="ETH",
5...     nft_id=["NT4EFBO-OWGI5-QLO7AG"],
6...     auction_type="fixed",
7...     auction_params={"allow_offers": True, "ask_price": 10},
8... )
get_auction_trades(auction_id: list[str] | None = None, end_time: int | None = None, start_time: int | None = None, nft_id: str | None = None, otp: str | None = None, *, extra_params: dict | None = None) dict

Get and filter for NFT auctions trades.

Parameters:
  • auction_id (Optional[list[str]], optional) – Auction ID to filter, defaults to None

  • end_time (Optional[int], optional) – Filter end time, defaults to None

  • start_time (Optional[int], optional) – Filter start time, defaults to None

  • nft_id (Optional[str], optional) – NFT ID, defaults to None

  • otp (Optional[str], optional) – One time password, defaults to None

NFT Trade: Get Auction trades
1>>> from kraken.nft import Trade
2>>> trade = Trade()
3>>> trade.get_auction_trades()
get_nft_wallet(chain: str | None = None, currency: str | None = None, custody: str | None = None, page: int = 1, per_page: int = 5, price_currency: str | None = None, price_high: str | float | int | None = None, price_low: str | float | int | None = None, search: str | None = None, sort: str | None = None, status: list[str] | None = None, otp: str | None = None, *, extra_params: dict | None = None) dict

Filter for user owned NFT wallets.

Parameters:
  • chain (Optional[str], optional) – Filter by chain, defaults to None

  • currency (Optional[str], optional) – Currency to show prices, defaults to None

  • custody (Optional[str], optional) – Kraken or Wallet, defaults to None

  • page (int, optional) – Filter by page, defaults to 1

  • per_page (int, optional) – Results per page, defaults to 5

  • price_currency (Optional[str], optional) – Price currency, defaults to None

  • price_high (Optional[str | float | int], optional) – Price high, defaults to None

  • price_low (Optional[str | float | int], optional) – Price low, defaults to None

  • search (Optional[str], optional) – Filter by NFT title/description, defaults to None

  • sort (Optional[str], optional) – Sort results, defaults to None

  • status (Optional[list[str]], optional) – Filter by status, defaults to None

  • otp (Optional[str], optional) – One time password, defaults to None

NFT Trade: Get NFT Wallets
1>>> from kraken.nft import Trade
2>>> trade = Trade()
3>>> trade.get_nft_wallet()
get_user_offers(pos: int, scope: str, sort: str, chain: list[str] | None = None, collection: list[str] | None = None, count: int | None = None, end_time: int | None = None, start_time: int | None = None, exclude_quotes: bool | None = None, nft_id: str | None = None, status: str | None = None, otp: str | None = None, *, extra_params: dict | None = None) dict

Retrieve and filter the user specific offers

Parameters:
  • pos (int) – Paging offset

  • scope (str) – placed or received offers

  • sort (str) – asc or desc

  • chain (Optional[list[str]], optional) – Filter by chain ID, defaults to None

  • collection (Optional[list[str]], optional) – Filter by collection, defaults to None

  • count (Optional[int], optional) – Offers to return per request, defaults to None

  • end_time (Optional[int], optional) – Latest offer time, defaults to None

  • start_time (Optional[int], optional) – Oldest offer time, defaults to None

  • exclude_quotes (Optional[bool], optional) – Exclude quotes, defaults to None

  • nft_id (Optional[str], optional) – Filter by NFT ID, defaults to None

  • status (Optional[str], optional) – Filter by offer status, defaults to None

  • otp (Optional[str], optional) – One time password, defaults to None

NFT Trade: Get User Offers
 1>>> from kraken.nft import Trade
 2>>> trade = Trade()
 3>>> trade.get_user_offers(
 4...     pos=1,
 5...     scope="placed",
 6...     sort="asc",
 7...     chain=["MATIC"],
 8...     exclude_quotes=True,
 9...     status="open",
10...     count=10,
11...     collection=["NCQNABO-XYCA7-JMMSDF"],
12... )
list_nft_transactions(end_time: int | None = None, start_time: int | None = None, nft_id: str | None = None, otp: str | None = None, page: int = 1, per_page: int = 5, sort: str = 'desc', type_: str | None = None, *, extra_params: dict | None = None) dict

Filter the users historical NFT transactions.

Parameters:
  • end_time (Optional[int], optional) – Latest result, defaults to None

  • start_time (Optional[int], optional) – Oldest result, defaults to None

  • nft_id (Optional[str], optional) – Filter by NFT ID, defaults to None

  • otp (Optional[str], optional) – One time password, defaults to None

  • page (int, optional) – Start page, defaults to 1

  • per_page (int, optional) – Entries per page, defaults to 5

  • sort (str, optional) – Sort results by, defaults to “desc”

  • type (Optional[str], optional) – Transaction type, defaults to None

NFT Trade: List NFT Transactions
1>>> from kraken.nft import Trade
2>>> trade = Trade()
3>>> trade.list_nft_transactions()
modify_auction(auction_id: str, ask_price: str | int | None = None, otp: str | None = None, reserve_price: str | int | None = None, *, extra_params: dict | None = None) dict

Modify an existing auction owned by the user

Parameters:
  • auction_id (str) – ID referencing the auction

  • ask_price (Optional[str | int], optional) – New ask price (only for fixed price auction type), defaults to None

  • otp (Optional[str], optional) – One time password, defaults to None

  • reserve_price (Optional[str | int], optional) – New reserve price (only for descending auction type), defaults to None

NFT Trade: Create Auction
1>>> from kraken.nft import Trade
2>>> trade = Trade()
3>>> trade.modify_auction(
4...     auction_id="AT2POJ-4CH3O-4TH6JH",ask_price="0.3",
5... )
place_offer(nft_id: list[str], offer_amount: str | int, offer_currency: str, quote_id: str | None = None, expire_time: int | None = None, otp: str | None = None, *, extra_params: dict | None = None) dict

Place a new NFT offer.

Parameters:
  • nft_id (list[str]) – The NFT ID of interest

  • offer_amount (str | int) – Offer amount

  • offer_currency (str) – Offer Currency

  • quote_id (Optional[str], optional) – Quote ID, defaults to None

  • expire_time (Optional[int], optional) – Expire time of that offer, defaults to None

  • otp (Optional[str], optional) – One time password, defaults to None

NFT Trade: Create Offer
1>>> from kraken.nft import Trade
2>>> trade = Trade()
3>>> trade.place_offer(
4...     nft_id=["AT2POJ-4CH3O-4TH6JH"],
5...     offer_amount=1,
6...     offer_currency="MATIC",
7... )
property return_unique_id: str

Returns a unique uuid string

Returns:

uuid

Return type:

str