$npx -y skills add basezh/agent-skills-on-base --skill neynarInteract with Farcaster via Neynar API. Use when the user wants to read Farcaster feeds, look up users, post casts, search content, or interact with the Farcaster social protocol. Requires NEYNAR_API_KEY.
| 1 | # Neynar (Farcaster API) |
| 2 | |
| 3 | Interact with the Farcaster decentralized social protocol via Neynar's API. |
| 4 | |
| 5 | ## Quick Start |
| 6 | |
| 7 | ### Setup |
| 8 | |
| 9 | 1. Get an API key from [dev.neynar.com](https://dev.neynar.com) |
| 10 | 2. Create config: |
| 11 | |
| 12 | ```bash |
| 13 | mkdir -p ~/.clawdbot/skills/neynar |
| 14 | cat > ~/.clawdbot/skills/neynar/config.json << 'EOF' |
| 15 | { |
| 16 | "apiKey": "YOUR_NEYNAR_API_KEY", |
| 17 | "signerUuid": "YOUR_SIGNER_UUID" |
| 18 | } |
| 19 | EOF |
| 20 | ``` |
| 21 | |
| 22 | **Note**: `signerUuid` is only required for posting casts. Get one via Neynar's signer management. |
| 23 | |
| 24 | ### Verify Setup |
| 25 | |
| 26 | ```bash |
| 27 | scripts/neynar.sh user dwr.eth |
| 28 | ``` |
| 29 | |
| 30 | ## Core Concepts |
| 31 | |
| 32 | - **FID** — Farcaster ID, a permanent numeric identifier for each user |
| 33 | - **Cast** — A post on Farcaster (like a tweet) |
| 34 | - **Channel** — Topic-based feeds (like subreddits) |
| 35 | - **Frame** — Interactive mini-apps embedded in casts |
| 36 | |
| 37 | ## Usage |
| 38 | |
| 39 | ### User Lookup |
| 40 | |
| 41 | ```bash |
| 42 | # By username |
| 43 | scripts/neynar.sh user vitalik.eth |
| 44 | |
| 45 | # By FID |
| 46 | scripts/neynar.sh user --fid 5650 |
| 47 | |
| 48 | # Multiple users |
| 49 | scripts/neynar.sh users dwr.eth,v,jessepollak |
| 50 | ``` |
| 51 | |
| 52 | ### Read Feed |
| 53 | |
| 54 | ```bash |
| 55 | # User's casts |
| 56 | scripts/neynar.sh feed --user dwr.eth |
| 57 | |
| 58 | # Channel feed |
| 59 | scripts/neynar.sh feed --channel base |
| 60 | |
| 61 | # Trending feed |
| 62 | scripts/neynar.sh feed --trending |
| 63 | |
| 64 | # Following feed (requires signer) |
| 65 | scripts/neynar.sh feed --following |
| 66 | ``` |
| 67 | |
| 68 | ### Search |
| 69 | |
| 70 | ```bash |
| 71 | # Search casts |
| 72 | scripts/neynar.sh search "ethereum" |
| 73 | |
| 74 | # Search users |
| 75 | scripts/neynar.sh search-users "vitalik" |
| 76 | |
| 77 | # Search in channel |
| 78 | scripts/neynar.sh search "onchain summer" --channel base |
| 79 | ``` |
| 80 | |
| 81 | ### Get Cast |
| 82 | |
| 83 | ```bash |
| 84 | # By hash |
| 85 | scripts/neynar.sh cast 0x1234abcd... |
| 86 | |
| 87 | # By URL |
| 88 | scripts/neynar.sh cast "https://warpcast.com/dwr.eth/0x1234" |
| 89 | ``` |
| 90 | |
| 91 | ### Post Cast (requires signer) |
| 92 | |
| 93 | ```bash |
| 94 | # Simple cast |
| 95 | scripts/neynar.sh post "gm farcaster" |
| 96 | |
| 97 | # Reply to cast |
| 98 | scripts/neynar.sh post "great point!" --reply-to 0x1234abcd |
| 99 | |
| 100 | # Cast in channel |
| 101 | scripts/neynar.sh post "hello base" --channel base |
| 102 | |
| 103 | # Cast with embed |
| 104 | scripts/neynar.sh post "check this out" --embed "https://example.com" |
| 105 | ``` |
| 106 | |
| 107 | ### Reactions |
| 108 | |
| 109 | ```bash |
| 110 | # Like a cast |
| 111 | scripts/neynar.sh like 0x1234abcd |
| 112 | |
| 113 | # Recast |
| 114 | scripts/neynar.sh recast 0x1234abcd |
| 115 | ``` |
| 116 | |
| 117 | ### Follow/Unfollow |
| 118 | |
| 119 | ```bash |
| 120 | scripts/neynar.sh follow dwr.eth |
| 121 | scripts/neynar.sh unfollow dwr.eth |
| 122 | ``` |
| 123 | |
| 124 | ## API Reference |
| 125 | |
| 126 | ### Endpoints Used |
| 127 | |
| 128 | | Action | Endpoint | Auth | |
| 129 | |--------|----------|------| |
| 130 | | User lookup | `GET /v2/farcaster/user/by_username` | API key | |
| 131 | | User by FID | `GET /v2/farcaster/user/bulk` | API key | |
| 132 | | User feed | `GET /v2/farcaster/feed/user/casts` | API key | |
| 133 | | Channel feed | `GET /v2/farcaster/feed/channels` | API key | |
| 134 | | Trending | `GET /v2/farcaster/feed/trending` | API key | |
| 135 | | Search casts | `GET /v2/farcaster/cast/search` | API key | |
| 136 | | Get cast | `GET /v2/farcaster/cast` | API key | |
| 137 | | Post cast | `POST /v2/farcaster/cast` | API key + Signer | |
| 138 | | React | `POST /v2/farcaster/reaction` | API key + Signer | |
| 139 | | Follow | `POST /v2/farcaster/user/follow` | API key + Signer | |
| 140 | |
| 141 | ### Response Format |
| 142 | |
| 143 | All responses are JSON. The script extracts key fields for readability: |
| 144 | |
| 145 | ```json |
| 146 | { |
| 147 | "user": { |
| 148 | "fid": 3, |
| 149 | "username": "dwr.eth", |
| 150 | "display_name": "Dan Romero", |
| 151 | "follower_count": 450000, |
| 152 | "following_count": 2800, |
| 153 | "verified_addresses": ["0x..."] |
| 154 | } |
| 155 | } |
| 156 | ``` |
| 157 | |
| 158 | ## Common Patterns |
| 159 | |
| 160 | ### Monitor a Channel |
| 161 | |
| 162 | ```bash |
| 163 | # Get latest casts from /base channel |
| 164 | scripts/neynar.sh feed --channel base --limit 20 |
| 165 | ``` |
| 166 | |
| 167 | ### Find Active Users |
| 168 | |
| 169 | ```bash |
| 170 | # Search for users by keyword |
| 171 | scripts/neynar.sh search-users "ethereum developer" |
| 172 | ``` |
| 173 | |
| 174 | ### Cross-Post from Twitter |
| 175 | |
| 176 | ```bash |
| 177 | # Post same content to Farcaster |
| 178 | scripts/neynar.sh post "gm, just shipped a new feature 🚀" |
| 179 | ``` |
| 180 | |
| 181 | ### Reply to Mentions |
| 182 | |
| 183 | ```bash |
| 184 | # Get your notifications (requires signer) |
| 185 | scripts/neynar.sh notifications |
| 186 | |
| 187 | # Reply to specific cast |
| 188 | scripts/neynar.sh post "thanks!" --reply-to 0xabc123 |
| 189 | ``` |
| 190 | |
| 191 | ## Error Handling |
| 192 | |
| 193 | | Error | Cause | Fix | |
| 194 | |-------|-------|-----| |
| 195 | | 401 Unauthorized | Invalid API key | Check `config.json` | |
| 196 | | 403 Forbidden | Signer required | Set up signer for write operations | |
| 197 | | 404 Not Found | User/cast doesn't exist | Verify username/hash | |
| 198 | | 429 Rate Limited | Too many requests | Wait and retry | |
| 199 | |
| 200 | ## Signer Setup |
| 201 | |
| 202 | For write operations (posting, liking, following), you need a signer: |
| 203 | |
| 204 | 1. Go to [dev.neynar.com](https://dev.neynar.com) |
| 205 | 2. Create a new signer or use managed signer |
| 206 | 3. Add `signerUuid` to your config |
| 207 | |
| 208 | **Managed signers** are easiest — Neynar handles the key custody. |
| 209 | |
| 210 | ## Rate Limits |
| 211 | |
| 212 | - Free tier: 300 requests/minute |
| 213 | - Paid tiers: Higher limits available |
| 214 | - Check `X-RateLimit-Remaining` header |
| 215 | |
| 216 | ## Best Practices |
| 217 | |
| 218 | 1. **Cache user lookups** — FIDs don't change, usernames rarely do |
| 219 | 2. **Use channels** — Better reach than random posting |
| 220 | 3. **Engage genuinely** — |