Comment on page
🧍
Check Single User
Learn how to use Airstack to check if a single user has XMTP or not.
JavaScript/TypeScript/Python
If you are using JavaScript/TypeScript or Python, Install the Airstack SDK:
npm
yarn
pnpm
pip
React
npm install @airstack/airstack-react
Node
npm install @airstack/node
React
yarn add @airstack/airstack-react
Node
yarn add @airstack/node
React
pnpm install @airstack/airstack-react
Node
pnpm install @airstack/node
pip install airstack
Then, add the following snippets to your code:
React
Node
Python
import { init, useQuery } from "@airstack/airstack-react";
init("YOUR_AIRSTACK_API_KEY");
const query = `YOUR_QUERY`; // Replace with GraphQL Query
const Component = () => {
const { data, loading, error } = useQuery(query);
if (data) {
return <p>Data: {JSON.stringify(data)}</p>;
}
if (loading) {
return <p>Loading...</p>;
}
if (error) {
return <p>Error: {error.message}</p>;
}
};
import { init, fetchQuery } from "@airstack/node";
init("YOUR_AIRSTACK_API_KEY");
const query = `YOUR_QUERY`; // Replace with GraphQL Query
const { data, error } = await fetchQuery(query);
console.log("data:", data);
console.log("error:", error);
import asyncio
from airstack.execute_query import AirstackClient
api_client = AirstackClient(api_key="YOUR_AIRSTACK_API_KEY")
query = """YOUR_QUERY""" # Replace with GraphQL Query
async def main():
execute_query_client = api_client.create_execute_query_object(
query=query)
query_response = await execute_query_client.execute_query()
print(query_response.data)
asyncio.run(main())
Other Programming Languages
To access the Airstack APIs in other languages, you can use https://api.airstack.xyz/gql as your GraphQL endpoint.
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.

Airstack AI (Demo)
Simply use the following query to check if a user has XMTP or not with this example of a user that has an XMTP:
https://app.airstack.xyz/query/ZT1QLdVkIx
Check Single User Has XMTP With 0x Address (Demo)
Query
Response
query MyQuery {
XMTPs(
input: {
blockchain: ALL
filter: { owner: { _eq: "0xa91c2d10a993d14f842d23b97f2ab3fdf6b5b9aa" } }
}
) {
XMTP {
isXMTPEnabled
}
}
}
{
"data": {
"XMTPs": {
"XMTP": [
{
"isXMTPEnabled": true
}
]
}
}
}
Here's an example of user the does not have any XMTP:
https://app.airstack.xyz/query/6oVZYGDzXG
Check Single User Does Not Have XMTP With 0x Address (Demo)
Query
Response
query MyQuery {
XMTPs(
input: {
blockchain: ALL
filter: { owner: { _eq: "0x5416e5dc14caa0950b2a24ede1eb0e97c360bcf5" } }
}
) {
XMTP {
isXMTPEnabled
}
}
}
{
"data": {
"XMTPs": {
"XMTP": null
}
}
}
With Airstack Identity API, you can simply swap the address input to any ENS names, either on-chain or off-chain (e.g. Namestone):
https://app.airstack.xyz/query/1n0kL621qf
Check Single User Has XMTP With ENS (Demo)
Query
Response
query MyQuery {
XMTPs(input: { blockchain: ALL, filter: { owner: { _eq: "vitalik.eth" } } }) {
XMTP {
isXMTPEnabled
}
}
}
{
"data": {
"XMTPs": {
"XMTP": [
{
"isXMTPEnabled": true
}
]
}
}
}
https://app.airstack.xyz/query/jr6QAbmRGb
Show me if yosephks.cb.id has XMTP enabled or not
Query
Response
query MyQuery {
XMTPs(
input: { blockchain: ALL, filter: { owner: { _eq: "yosephks.cb.id" } } }
) {
XMTP {
isXMTPEnabled
}
}
}
{
"data": {
"XMTPs": {
"XMTP": [
{
"isXMTPEnabled": true
}
]
}
}
}
https://app.airstack.xyz/query/ngQHil80AU
Check Single User Has XMTP With Lens Profile Name (Demo)
Query
Response
query MyQuery {
XMTPs(
input: { blockchain: ALL, filter: { owner: { _eq: "lens/@vitalik" } } }
) {
XMTP {
isXMTPEnabled
}
}
}
{
"data": {
"XMTPs": {
"XMTP": [
{
"isXMTPEnabled": true
}
]
}
}
}
Alternatively, you can also swap the address input
owner
to any Lens profile ID, either in decimal or hex form:https://app.airstack.xyz/query/QO9CcBlwQY
Check Single User Has XMTP With Lens Profile ID (Demo)
Query
Response
query MyQuery {
XMTPs(
input: { blockchain: ALL, filter: { owner: { _eq: "lens_id:100275" } } }
) {
XMTP {
isXMTPEnabled
}
}
}
{
"data": {
"XMTPs": {
"XMTP": [
{
"isXMTPEnabled": true
}
]
}
}
}
https://app.airstack.xyz/query/ju22glZstP
Check Single User Has XMTP With Farcaster Name (Demo)
Query
Response
query MyQuery {
XMTPs(
input: {
blockchain: ALL
filter: { owner: { _eq: "fc_fname:vitalik.eth" } }
}
) {
XMTP {
isXMTPEnabled
}
}
}
{
"data": {
"XMTPs": {
"XMTP": [
{
"isXMTPEnabled": true
}
]
}
}
}
Alternatively, you can also swap the address input
owner
to any Farcaster ID:https://app.airstack.xyz/query/g2m7nSXVBQ
Check Single User Has XMTP With Farcaster ID (Demo)
Query
Response
query MyQuery {
XMTPs(input: { blockchain: ALL, filter: { owner: { _eq: "fc_fid:5650" } } }) {
XMTP {
isXMTPEnabled
}
}
}
{
"data": {
"XMTPs": {
"XMTP": [
{
"isXMTPEnabled": true
}
]
}
}
}
If you have any questions or need help regarding checking XMTP for a single user with various web3 identities, please join our Airstack's Telegram group.
- 1.e.g. lens/@vitalik
- 2.e.g.
lens_id:0x19af
Last modified 18h ago