Skip to main content
GET
https://api.scriptbase.app
/
api
/
v1
/
search
curl "https://api.scriptbase.app/api/v1/search?q=react+tutorial&type=video&duration=medium" \
  -H "X-API-Key: sk_your_key_here"
{
  "success": true,
  "data": {
    "query": "react tutorial",
    "results": [
      {
        "type": "video",
        "id": "w7ejDZ8SWv8",
        "title": "React JS Full Course 2024",
        "description": "Learn React from scratch...",
        "thumbnail": "https://i.ytimg.com/vi/w7ejDZ8SWv8/maxresdefault.jpg",
        "duration": 14400,
        "viewCount": 5000000,
        "uploadDate": "2024-01-15T00:00:00.000Z",
        "channel": {
          "id": "UCW5YeuERMmlnqo4oq8vGKAg",
          "name": "Fireship",
          "thumbnail": "https://yt3.ggpht.com/..."
        }
      },
      {
        "type": "channel",
        "id": "UC29ju8bIPH5as8OGnQzwJyA",
        "title": "Traversy Media",
        "description": "Practical project-based web development...",
        "thumbnail": "https://yt3.ggpht.com/...",
        "subscriberCount": 2100000,
        "videoCount": 900
      }
    ],
    "totalResults": 15000,
    "nextPageToken": "CDIQAA"
  },
  "meta": {
    "creditsUsed": 1,
    "creditsRemaining": 999,
    "rateLimit": {
      "limit": 60,
      "remaining": 59,
      "resetAt": 1704326400
    }
  }
}

Overview

Search YouTube content with powerful filters including type, upload date, duration, sort order, and video features.

Authentication

X-API-Key
string
required
Your API key

Query Parameters

q
string
required
Search query string (max 500 characters)
type
string
default:"all"
Filter by content type: all, video, channel, or playlist
uploadDate
string
default:"all"
Filter by upload date: all, hour, today, week, month, or year
duration
string
default:"all"
Filter by video duration: all, short (<4 min), medium (4-20 min), or long (>20 min)
sortBy
string
default:"relevance"
Sort order: relevance, views, date, or rating
features
string
Comma-separated list of features: hd, subtitles, creative-commons, 3d, live, 4k, 360, location, hdr, vr180
limit
number
default:"20"
Maximum number of results (1-5000, auto-paginates)
pageToken
string
Token for next page of results

Credits

  • Cost: 1 credit per page of results

Response

success
boolean
Whether the request was successful
data
object
curl "https://api.scriptbase.app/api/v1/search?q=react+tutorial&type=video&duration=medium" \
  -H "X-API-Key: sk_your_key_here"
{
  "success": true,
  "data": {
    "query": "react tutorial",
    "results": [
      {
        "type": "video",
        "id": "w7ejDZ8SWv8",
        "title": "React JS Full Course 2024",
        "description": "Learn React from scratch...",
        "thumbnail": "https://i.ytimg.com/vi/w7ejDZ8SWv8/maxresdefault.jpg",
        "duration": 14400,
        "viewCount": 5000000,
        "uploadDate": "2024-01-15T00:00:00.000Z",
        "channel": {
          "id": "UCW5YeuERMmlnqo4oq8vGKAg",
          "name": "Fireship",
          "thumbnail": "https://yt3.ggpht.com/..."
        }
      },
      {
        "type": "channel",
        "id": "UC29ju8bIPH5as8OGnQzwJyA",
        "title": "Traversy Media",
        "description": "Practical project-based web development...",
        "thumbnail": "https://yt3.ggpht.com/...",
        "subscriberCount": 2100000,
        "videoCount": 900
      }
    ],
    "totalResults": 15000,
    "nextPageToken": "CDIQAA"
  },
  "meta": {
    "creditsUsed": 1,
    "creditsRemaining": 999,
    "rateLimit": {
      "limit": 60,
      "remaining": 59,
      "resetAt": 1704326400
    }
  }
}

Error Codes

StatusCodeDescription
400INVALID_INPUTInvalid query parameters
401INVALID_API_KEYAPI key is missing or invalid
429QUOTA_EXCEEDEDMonthly quota exhausted
429RATE_LIMIT_EXCEEDEDToo many requests
  • Results are paginated. Use nextPageToken to fetch additional pages.
  • The totalResults is an estimate and may not be exact.
  • Some filters like features only apply to video results.