Skip to main content

Media Gateway

We provide public endpoints for accessing NBA Top Shot media assets. Since media assets are associated with their corresponding on-chain identifier data, running scripts to acquire the on-chain identifiers are often necessary.


The endpoint can be accessed at:${momentFlowID}/${mediaType}


momentFlowID is the flowId for the moment you are trying to access. To get a list of IDs for a given account, you can use the following cadence script:

import TopShot from 0xTOPSHOTADDRESS

pub fun main(account: Address): [UInt64] {

let acct = getAccount(account)

let collectionRef = acct.getCapability(/public/MomentCollection)

return collectionRef.getIDs()

The returned IDs can then be used to obtain the moments media.


mediaType can be selected from the following list:

  • video-texture - main video that is seen on the moment page 1080x1080 with texture background

  • video-tall - main video that is seen on the moment page 1080x1920 with black background

  • image, hero - first frame from the moment

  • game - image that shows the game scores **

  • player - picture of the player

  • transparent - first frame from the moment with transparent background

  • hero-wide - first frame from the moment with wide background

Resize Params

The media gateway also supports resizing images by adding query params. You may add as many or as few as you like to suit your needs.


The videos cannot be resized.


the format of the image can be changed to suit your needs as seen in the cloudflare documentation. We recommend using webp


specifies the quality of the image, for a high quality images we recommend 90, for a lower quality image you can go with 50


the maximum width of the image


the maximum height of the image