Skip to content

cURL Examples

Here are practical examples of how to use the Regular Show API with cURL.

API Information

bash
curl https://regularshow-api.vercel.app/api

Characters

Get All Characters (first 20)

bash
curl https://regularshow-api.vercel.app/api/character

Get Characters with Pagination

bash
curl "https://regularshow-api.vercel.app/api/character?page=2&limit=10"

Search Characters by Name

bash
curl "https://regularshow-api.vercel.app/api/character?name=Mordecai"

Filter by Category

bash
# Get all villains
curl "https://regularshow-api.vercel.app/api/character?category=Villains"

# Get main characters
curl "https://regularshow-api.vercel.app/api/character?category=Main%20Characters"

# Get antagonists
curl "https://regularshow-api.vercel.app/api/character?category=Antagonists"

Get Single Character by ID

bash
curl https://regularshow-api.vercel.app/api/character/2037

Get Single Character by Slug

bash
curl https://regularshow-api.vercel.app/api/character/Benson
curl https://regularshow-api.vercel.app/api/character/Mordecai

Get Character Image

bash
curl https://regularshow-api.vercel.app/api/character/Benson/image

Episodes

Get All Episodes

bash
curl https://regularshow-api.vercel.app/api/episode

Filter by Season

bash
curl "https://regularshow-api.vercel.app/api/episode?season=1"
curl "https://regularshow-api.vercel.app/api/episode?season=2"

Search by Name

bash
curl "https://regularshow-api.vercel.app/api/episode?name=Power"

Get Single Episode by ID

bash
curl https://regularshow-api.vercel.app/api/episode/1

Get Single Episode by Slug

bash
curl https://regularshow-api.vercel.app/api/episode/The_Power

Seasons

Get All Seasons

bash
curl https://regularshow-api.vercel.app/api/season

Get Season Details

bash
curl https://regularshow-api.vercel.app/api/season/1
curl https://regularshow-api.vercel.app/api/season/2

Get Shorts

bash
curl https://regularshow-api.vercel.app/api/season/shorts

Stats

bash
curl https://regularshow-api.vercel.app/api/stats

Save Response to File

bash
# Save characters to file
curl https://regularshow-api.vercel.app/api/character > characters.json

# Save with formatting
curl https://regularshow-api.vercel.app/api/character | python3 -m json.tool > characters_pretty.json

Using with jq

bash
# Get just the character names
curl -s https://regularshow-api.vercel.app/api/character | jq '.results[].name'

# Get first 5 character names
curl -s https://regularshow-api.vercel.app/api/character | jq '.results[:5] | .[].name'

# Get count of characters
curl -s https://regularshow-api.vercel.app/api/character | jq '.info.count'

# Get all villain names
curl -s "https://regularshow-api.vercel.app/api/character?category=Villains" | jq '.results[].name'

Using in Shell Scripts

bash
#!/bin/bash

# Get random character
CHARACTERS=$(curl -s https://regularshow-api.vercel.app/api/character?limit=100)
COUNT=$(echo $CHARACTERS | jq '.info.count')
RANDOM_ID=$((1 + RANDOM % COUNT))

curl -s "https://regularshow-api.vercel.app/api/character?page=$RANDOM_ID&limit=1" | jq '.results[0]'

HTTP Headers

If you need to add custom headers:

bash
# Add User-Agent
curl -H "User-Agent: MyApp/1.0" https://regularshow-api.vercel.app/api

# Add Accept header
curl -H "Accept: application/json" https://regularshow-api.vercel.app/api

POST Requests (Future)

Some endpoints may support POST requests:

bash
# Example (if available)
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"name": "Mordecai"}' \
  https://regularshow-api.vercel.app/api/character/search

Released under the MIT License.