Airstack provides an AI solution for you to build GraphQL queries to fulfill your use case easily. You can find the AI prompt of each query in the demo's caption or title for yourself to try.
Get ENS Profile Image
You can provide the domain name, e.g. vitalik.eth, into the name input filter and fetch the ENS profile image from the response with the tokenNft.contentValue.image field:
The images returned will already be resized by Airstack and can be used directly within your application:
extra_small: 125x125px
small: 250x250px
medium: 500x500px
large: 750x750px
Try Demo
Code
queryMyQuery { Domains( input: { filter: { name: { _eq: "vitalik.eth" } }, blockchain: ethereum } ) { Domain { tokenNft { contentValue { image { extraSmall small medium large original } } } } }}
You can provide the Lens handle, e.g. lens/@vitalik, into the profileName input filter and fetch the Lens profile image from the response with the profileImage giving the original profile image and profileImageContentValue providing the resized versions:
The images returned will already be resized by Airstack and can be used directly within your application:
extra_small: 125x125px
small: 250x250px
medium: 500x500px
large: 750x750px
Try Demo
Code
queryMyQuery { Socials( input: {filter: { profileName: { _eq: "lens/@vitalik" }, dappName: { _eq: lens } }blockchain: ethereum } ) { Social { profileImage profileImageContentValue { image { extraSmall large medium original small } } } }}
You can provide the user's fname, e.g. vitalik.eth, into the profileName input filter and fetch the Farcaster profile image from the response with the profileImage giving the original profile image and profileImageContentValue providing the resized versions:
The images returned will already be resized by Airstack and can be used directly within your application:
extra_small: 125x125px
small: 250x250px
medium: 500x500px
large: 750x750px
Try Demo
Code
queryMyQuery { Socials( input: {filter: {profileName: { _eq: "vitalik.eth" }dappName: { _eq: farcaster } }blockchain: ethereum } ) { Social { profileImage profileImageContentValue { image { extraSmall large medium original small } } } }}