# Introduction

Neynar provides APIs to easily interact with the [Farcaster](https://www.farcaster.xyz/) decentralized social protocol. These APIs let you query user data, social graphs, and content (casts), enabling you to build decentralized social apps quickly.

## Core Concepts

Farcaster has a few key primitives you’ll interact with via the Neynar API:

- **User** — Each user has a permanent **FID** (Farcaster ID) that identifies them. Profile details such as username, display name, bio, and linked accounts are stored on-chain and mapped to this FID.
- **Cast** — A unit of content posted to Farcaster, similar to a tweet on X. Each cast has a unique **hash** and may contain text, media, embeds, and metadata.
- **Social Graph** — The network of follower/following relationships between users.
- **Feeds** — Collections of casts, often based on a user’s social graph, channel membership, or other filters.

All data is open and decentralized, available on Farcaster hubs. Neynar abstracts away the complexity of querying these hubs.

## Base URL

All requests to the Neynar API must be made to:

```
https://api.neynar.com
```

HTTPS is required for all requests. HTTP requests will be rejected.

## Authentication

All API endpoints require an API key. Include the following header with every request:

```
x-api-key
```

string

required

Your Neynar API key as a string.

You can obtain your API key from the [Developer Portal](https://dev.neynar.com/) after signing up.

Neynar APIs support payment per API request via [x402](https://www.x402.org/). API requests missing an API key header will see an x402 error to pay per request.

## Examples

- JavaScript

```javascript
fetch('https://api.neynar.com/v2/farcaster/user/bulk?fids=1', {
  method: 'GET',
  headers: {
    'x-api-key': 'insert-your-api-key',
    'Content-Type': 'application/json'
  }
})
.then(response => response.json())
.then(data => console.log(data));
```

```bash
curl -X GET "https://api.neynar.com/v2/farcaster/user/bulk?fids=1" \
  -H "x-api-key: insert-your-api-key" \
  -H "Content-Type: application/json"
```

```python
import requests

api_key = "insert-your-api-key"

headers = {
    "x-api-key": api_key,
    "Content-Type": "application/json"
}

response = requests.get("https://api.neynar.com/v2/farcaster/user/bulk?fids=1", headers=headers)
data = response.json()
print(data)
```
