๐Unfollow
Learn how to use Airstack webhooks to listen to various use cases on unfollow events on the Farcaster network.
Listen To All Unfollow Events On Farcaster
You can use Airstack webhooks to listen to all Farcaster unfollow events by using the following configuration:
curl -X 'POST' \
'https://webhooks.airstack.xyz/api/v1/webhooks' \
-H 'accept: application/json' \
-H 'Authorization: <YOUR_AIRSTACK_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"endpoint": "https://webhook.site",
"filter_config": {
"event_type": "follow.deleted"
}
}'
// Prerequisites: npm install axios
import axios from 'axios';
const url = 'https://webhooks.airstack.xyz/api/v1/webhooks';
const headers = {
'accept': 'application/json',
'Authorization': 'YOUR_AIRSTACK_API_KEY',
'Content-Type': 'application/json'
};
const data = {
endpoint: 'https://webhook.site', // your endpoint
filter_config: {
event_type: 'follow.deleted', // Listen to all unfollow events
}
};
axios.post(url, data, { headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('There was an error!', error);
});
// Prerequisites: npm install axios
const axios = require('axios');
const url = 'https://webhooks.airstack.xyz/api/v1/webhooks';
const headers = {
'accept': 'application/json',
'Authorization': 'YOUR_AIRSTACK_API_KEY',
'Content-Type': 'application/json'
};
const data = {
endpoint: 'https://webhook.site', // your endpoint
filter_config: {
event_type: 'follow.deleted', // Listen to all unfollow events
}
};
axios.post(url, data, { headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('There was an error!', error);
});
{
"id": "000000020c162a7ffcaf089ae12f3e53372302cde3c95cf6bab7b3244df5daa6",
"dappName": "farcaster",
"dappSlug": "farcaster_v3_optimism",
"eventTimestamp": "2024-05-11T08:43:50.531Z",
"followerProfileId": "3761"
"followingProfileId": "326089",
"followerSince": "2024-02-09T07:37:59Z"
}
Listen To Any Farcaster User That Unfollows A Certain Farcaster User
You can use Airstack webhooks to listen to all events when any Farcaster user is unfollowing a certain FID by using the following configuration:
curl -X 'POST' \
'https://webhooks.airstack.xyz/api/v1/webhooks' \
-H 'accept: application/json' \
-H 'Authorization: <YOUR_AIRSTACK_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"endpoint": "https://webhook.site",
"filter_config": {
"event_type": "follow.deleted",
"filter": {
"followerProfileId": "3761"
},
"payload": {
"followerProfileId": "3761",
"followingProfileId": "326089"
}
}
}'
// Prerequisites: npm install axios
import axios from 'axios';
const url = 'https://webhooks.airstack.xyz/api/v1/webhooks';
const headers = {
'accept': 'application/json',
'Authorization': 'YOUR_AIRSTACK_API_KEY',
'Content-Type': 'application/json'
};
const data = {
endpoint: 'https://webhook.site', // your endpoint
filter_config: {
event_type: 'follow.deleted', // Listen to all unfollow events
filter: {
followerProfileId: "3761" // filter by this FID
},
payload: {
// Ensure that this field matched the value in filter
followerProfileId: "3761",
followingProfileId: "326089"
}
}
};
axios.post(url, data, { headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('There was an error!', error);
});
// Prerequisites: npm install axios
const axios = require('axios');
const url = 'https://webhooks.airstack.xyz/api/v1/webhooks';
const headers = {
'accept': 'application/json',
'Authorization': 'YOUR_AIRSTACK_API_KEY',
'Content-Type': 'application/json'
};
const data = {
endpoint: 'https://webhook.site', // your endpoint
filter_config: {
event_type: 'follow.deleted', // Listen to all unfollow events
filter: {
followerProfileId: "3761" // filter by this FID
},
payload: {
// Ensure that this field matched the value in filter
followerProfileId: "3761",
followingProfileId: "326089"
}
}
};
axios.post(url, data, { headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('There was an error!', error);
});
{
"id": "000000020c162a7ffcaf089ae12f3e53372302cde3c95cf6bab7b3244df5daa6",
"dappName": "farcaster",
"dappSlug": "farcaster_v3_optimism",
"eventTimestamp": "2024-05-11T08:43:50.531Z",
"followerProfileId": "3761"
"followingProfileId": "326089",
"followerSince": "2024-02-09T07:37:59Z"
}
Listen To A Farcaster User When Unfollowing Another Farcaster User
You can use Airstack webhooks to listen to all Farcaster unfollow events initiated by a Farcaster user by using the following configuration:
curl -X 'POST' \
'https://webhooks.airstack.xyz/api/v1/webhooks' \
-H 'accept: application/json' \
-H 'Authorization: <YOUR_AIRSTACK_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"endpoint": "https://webhook.site",
"filter_config": {
"event_type": "follow.deleted",
"filter": {
"followingProfileId": "326089"
},
"payload": {
"followerProfileId": "3761",
"followingProfileId": "326089"
}
}
}'
// Prerequisites: npm install axios
import axios from 'axios';
const url = 'https://webhooks.airstack.xyz/api/v1/webhooks';
const headers = {
'accept': 'application/json',
'Authorization': 'YOUR_AIRSTACK_API_KEY',
'Content-Type': 'application/json'
};
const data = {
endpoint: 'https://webhook.site', // your endpoint
filter_config: {
event_type: 'follow.deleted', // Listen to all unfollow events
filter: {
followingProfileId: "326089" // filter by this FID
},
payload: {
followerProfileId: "3761",
// Ensure that this field matched the value in filter
followingProfileId: "326089"
}
}
};
axios.post(url, data, { headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('There was an error!', error);
});
// Prerequisites: npm install axios
const axios = require('axios');
const url = 'https://webhooks.airstack.xyz/api/v1/webhooks';
const headers = {
'accept': 'application/json',
'Authorization': 'YOUR_AIRSTACK_API_KEY',
'Content-Type': 'application/json'
};
const data = {
endpoint: 'https://webhook.site', // your endpoint
filter_config: {
event_type: 'follow.deleted', // Listen to all unfollow events
filter: {
followingProfileId: "326089" // filter by this FID
},
payload: {
followerProfileId: "3761",
// Ensure that this field matched the value in filter
followingProfileId: "326089"
}
}
};
axios.post(url, data, { headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('There was an error!', error);
});
{
"id": "000000020c162a7ffcaf089ae12f3e53372302cde3c95cf6bab7b3244df5daa6",
"dappName": "farcaster",
"dappSlug": "farcaster_v3_optimism",
"eventTimestamp": "2024-05-11T08:43:50.531Z",
"followerProfileId": "3761"
"followingProfileId": "326089",
"followerSince": "2024-02-09T07:37:59Z"
}
Developer Support
If you have any questions or need help regarding creating webhook for listening to Farcaster unfollowing events, please join our Airstack's Telegram group.
More Resources
Last updated