# Create a Podcast from X Feed

Learn how to create a feed from an X (Twitter) account and use it to generate AI-powered podcast content from the latest posts.

> Building feeds through the dashboard first? Follow [Create a Feed](https://github.com/miguelpieras/autocontentapi-docs/blob/main/quick-start/create-feed.md) for the in-app workflow and then return here for the raw API calls.

## Step 1: Create an X Feed

First, create a feed from an X account by sending a POST request to `/feeds`:

```bash
curl -X POST "https://api.autocontentapi.com/feeds" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Tech News from Elon Musk",
    "feedTypeId": 1,
    "internalId": "elonmusk"
  }'
```

### Request Parameters

| Parameter    | Description                | Example                      |
| ------------ | -------------------------- | ---------------------------- |
| `name`       | Display name for your feed | `"Tech News from Elon Musk"` |
| `feedTypeId` | Feed type (1 = X/Twitter)  | `1`                          |
| `internalId` | X username (without @)     | `"elonmusk"`                 |

### Example Response

```json
{
  "success": true,
  "feedId": 42,
  "message": "Feed created successfully"
}
```

**Important:** Save the `feedId` - you'll use it to generate podcasts from this feed!

## Step 2: Create Podcast from Feed

Now use the feed ID to generate a podcast from the latest posts:

```bash
curl -X POST "https://api.autocontentapi.com/content/Create" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "feeds": [42],
    "outputType": "audio",
    "text": "Create an engaging podcast discussing the latest tweets and their implications",
    "duration": "default"
  }'
```

### Example Response

```json
{
  "request_id": "feed-550e8400-e29b-41d4-a716-446655440001",
  "status": 0
}
```

## Step 3: Poll for Status

Use the `request_id` to check processing status:

```bash
curl -X GET "https://api.autocontentapi.com/content/Status/feed-550e8400-e29b-41d4-a716-446655440001" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

### While Processing

```json
{
  "id": "feed-550e8400-e29b-41d4-a716-446655440001",
  "status": 5,
  "updated_on": "2024-01-15T10:32:00Z",
  "error_code": 0,
  "requested_on": "2024-01-15T10:30:00Z"
}
```

## Step 4: Get Your Feed-Based Podcast

When `status` reaches `100`, your podcast is ready:

```json
{
  "id": "feed-550e8400-e29b-41d4-a716-446655440001",
  "audio_title": "Latest Updates from Tech Leaders",
  "status": 100,
  "audio_url": "https://storage.autocontentapi.com/audio/feed-550e8400-e29b-41d4-a716-446655440001.mp3",
  "response_text": "Full transcript discussing the latest posts from the feed...",
  "requested_on": "2024-01-15T10:30:00Z",
  "updated_on": "2024-01-15T10:35:00Z",
  "request_type_id": 1,
  "error_code": 0,
  "file_size": 18734521,
  "audio_duration": 567.89,
  "share_url": "https://autocontentapi.com/share/feed-550e8400-e29b-41d4-a716-446655440001"
}
```

## Managing Your Feeds

### List All Your Feeds

```bash
curl -X GET "https://api.autocontentapi.com/feeds" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

### Get Specific Feed Details

```bash
curl -X GET "https://api.autocontentapi.com/feeds/42" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

### Delete a Feed

```bash
curl -X POST "https://api.autocontentapi.com/feeds/delete" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id": 42
  }'
```

## Advanced: Multiple Feeds

You can combine multiple feeds in a single podcast request:

```bash
curl -X POST "https://api.autocontentapi.com/content/Create" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "feeds": [42, 43, 44],
    "outputType": "audio",
    "text": "Create a podcast discussing the latest posts from these tech leaders",
    "duration": "long"
  }'
```

**Note:** Maximum of 10 feeds per request.

## Feed Limitations

* **Feed Limit:** You can create up to 4 feeds per account
* **Rate Limiting:** Wait 3 seconds between feed creation requests
* **Feed Types:** Currently only X/Twitter feeds are supported (feedTypeId = 1)
* **Username Format:** Use the X username without the @ symbol

## Popular X Accounts for Tech Feeds

Here are some popular tech accounts you might want to create feeds from:

| Username       | Description                 |
| -------------- | --------------------------- |
| `elonmusk`     | Tesla/SpaceX CEO insights   |
| `sundarpichai` | Google CEO updates          |
| `satyanadella` | Microsoft CEO thoughts      |
| `tim_cook`     | Apple CEO announcements     |
| `jeffbezos`    | Amazon founder perspectives |
| `naval`        | Startup and tech philosophy |
| `balajis`      | Crypto and tech trends      |

## Error Handling

### Feed Creation Errors

```json
{
  "success": false,
  "error": "Feed limit reached. You can create up to 4 feeds. You currently have 4 feeds."
}
```

### Rate Limit Error

```json
{
  "success": false,
  "error": "Rate limit exceeded. Please wait 3 seconds before creating another feed."
}
```

## Use Cases

**Daily Tech Briefings:** Create feeds from multiple tech leaders and generate daily summary podcasts

**Industry Analysis:** Follow specific industry accounts and create weekly analysis podcasts

**Event Coverage:** Create temporary feeds during conferences or product launches

**Competitor Monitoring:** Track competitor announcements and create regular update podcasts

## What's Next?

* 🎧 Learn about [Creating Basic Podcasts](https://docs.autocontentapi.com/quick-start/podcasts/create-podcast-episode) from web resources
* 📖 Explore more [Code Samples](https://docs.autocontentapi.com/code-samples) in different languages
* 🗣️ Discover [Custom Voices](https://docs.autocontentapi.com/voices) for personalized feed podcasts
* ❓ Have questions? Visit our [FAQ](https://docs.autocontentapi.com/faq)
