# Farcaster

Monitor new casts on the Farcaster protocol, filtering by author, mentions, or keywords. This event type can be used to track specific users, identify trending topics, or even build a new Farcaster client.

**Event Type:** `FARCASTER_CAST`

To create a Farcaster event type, send a `POST` request to the `/api/v1/nodefy/notifications/` endpoint with the following JSON payload:

#### Example Request:

```json
{
  "external_user_id": "user123",                           
  "channel": "WEBHOOK",                                    
  "notification_name": "New Farcaster Cast",             
  "delivery_location": "https://webhook.site/cdcf-6718df-asdf",
  "event_details": {
        "network": "FARCASTER",
        "event_type": "FARCASTER_CAST",
        "text": ["keyword1"]
  }
}
```

#### Required `FARCASTER_CAST` Parameters:

*One* of the following parameters must be provided in order to successfully create a webhook to monitor all casts:

* **`text`:** A string containing keywords. The webhook will trigger if any of these keywords are found in a cast.
* **`author_fids`:** An array of Farcaster user IDs (FIDs) to monitor. The webhook will trigger for new casts created by these users.
* **`mentioned_fids`:** An array of FIDs that, if mentioned in a cast, will trigger the webhook.
* **`channel`:** A string of the Farcaster channel name. The webhook will trigger for new casts in this channel(s).

#### Farcaster Event Filters

You can apply more specific filters on Farcaster events using our filter system. Filters allow you to capture events based on parameters such as a range of FIDs, power badge status, and more. Refer to the ["Using Filters"](https://docs.nodefy.xyz/our-api-guide/using-filters) section for more information.

#### Example Webhook Payload:

```json
{
  "createdAt": "2024-06-13T18:39:18.083001",
  "data": {
    "notification_name": "Farcaster Payload Test",
    "transaction_hash": "0x81f2a83527061c536d03c9c9be97b28059c7eced",
    "from_wallet": [
      "0xdd7a372377fc633f74ab6e20963803d52f448830"
    ],
    "to_wallet": "Undefined",
    "status": "",
    "asset": "Undefined",
    "value": "This is the cast text that contains a keyword you filtered on",
    "type": "FARCASTER_CAST",
    "network": "FARCASTER",
    "hook_payload": {
      "object": "cast",
      "hash": "0x81f2a83527061c536d03c9c9be97b28059c7eced",
      "thread_hash": "0x81f2a83527061c536d03c9c9be97b28059c7eced",
      "parent_hash": null,
      "parent_url": null,
      "root_parent_url": null,
      "parent_author": {
        "fid": null
      },
      "author": {
        "object": "user",
        "fid": 20698,
        "custody_address": "0x64cc8f7ff6d27151a4deb00674419c7453ca9775",
        "username": "baznocap",
        "display_name": "RJ ⚡️🎩🔵↑",
        "pfp_url": "https://i.imgur.com/dZEGWaA.jpg",
        "profile": {
          "bio": {
            "text": "Building Nodefy.xyz to improve onchain visibility"
          }
        },
        "follower_count": 342,
        "following_count": 285,
        "verifications": [
          "0xdd7a372377fc633f74ab6e20963803d52f448830"
        ],
        "verified_addresses": {
          "eth_addresses": [
            "0xdd7a372377fc633f74ab6e20963803d52f448830"
          ],
          "sol_addresses": []
        },
        "active_status": "inactive",
        "power_badge": false
      },
      "text": "This is the cast text that contains a keyword you filtered on",
      "timestamp": "2024-06-13T18:39:06.000Z",
      "embeds": [],
      "reactions": {
        "likes_count": 0,
        "recasts_count": 0,
        "likes": [],
        "recasts": []
      },
      "replies": {
        "count": 0
      },
      "mentioned_profiles": []
    },
    "author": "baznocap"
  }
}
```
