WASIF TV API
Free, fast, and reliable Live TV streaming API. Integrate 100+ live TV channels into your website or app with just a few lines of code.
Authentication
Our public API endpoints do not require any API keys or tokens. You can make requests directly from your frontend (browser) or backend (server).
Rate Limits
To ensure fair usage and stability, we apply the following rate limits:
| Endpoint | Limit |
|---|---|
| /api/channel.php | 120 requests / minute / IP |
| /api/categories.php | 120 requests / minute / IP |
| /api/stream.php | 120 requests / minute / IP |
429 Too Many Requests response.
List All Channels
Returns a list of all active live TV channels. You can optionally filter by category.
https://tv.wasifali.tech/api/channel.php
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| category | string | No | Filter by category slug (e.g., news, sports) |
| id | integer | No | Get a single channel by ID |
Example Request
GET https://tv.wasifali.tech/api/channel.php?category=news
Example Response
{
"status": true,
"data": {
"count": 2,
"category": "news",
"data": [
{
"id": 26,
"name": "ARY News",
"category": "news",
"logo": "https://tv.wasifali.tech/assets/img/logos/26.webp",
"views": 4321
},
{
"id": 27,
"name": "Geo News",
"category": "news",
"logo": "https://tv.wasifali.tech/assets/img/logos/27.webp",
"views": 3890
}
]
}
}
List Categories
Returns all available categories with channel counts.
https://tv.wasifali.tech/api/categories.php
Example Response
{
"status": true,
"data": {
"count": 3,
"data": [
{ "slug": "entertainment", "label": "Entertainment", "icon": "🎭", "count": 35 },
{ "slug": "news", "label": "News", "icon": "📰", "count": 28 },
{ "slug": "sports", "label": "Sports", "icon": "⚽", "count": 4 }
]
}
}
Get Stream URL
Returns a secure proxy URL to play a specific channel. The URL is valid for 1 hour.
https://tv.wasifali.tech/api/stream.php?id=17
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | The channel ID from the channel list |
Example Response
{
"status": true,
"data": {
"channel_id": 17,
"name": "Green Entertainment",
"category": "entertainment",
"logo": "https://tv.wasifali.tech/assets/img/logos/17.webp",
"play_url": "https://tv.wasifali.tech/backend/stream_proxy.php?ch=17&t=HMAC_TOKEN&exp=1735689600",
"expires_in": 3600,
"expires_at": 1735689600
}
}
play_url for more than an hour. Request a new one when expired.
JavaScript Example (HLS.js)
Here is how you can play a channel using our API and HLS.js.
<video id="video" controls></video>
<script src="https://cdn.jsdelivr.net/npm/hls.js@1"></script>
<script>
async function playChannel(channelId) {
// 1. Fetch the secure stream URL from our API
const res = await fetch('https://tv.wasifali.tech/api/stream.php?id=' + channelId);
const json = await res.json();
if (!json.status) return alert('Channel not found');
const playUrl = json.data.play_url;
// 2. Play using HLS.js
const video = document.getElementById('video');
if (Hls.isSupported()) {
const hls = new Hls();
hls.loadSource(playUrl);
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED, () => video.play());
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = playUrl;
video.play();
}
}
// Play channel ID 17
playChannel(17);
</script>
PHP Example
Fetching the stream URL using PHP cURL.
<?php
$channelId = 17;
$apiUrl = 'https://tv.wasifali.tech/api/stream.php?id=' . $channelId;
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
if ($data['status']) {
echo "Stream URL: " . $data['data']['play_url'];
} else {
echo "Error: " . $data['message'];
}
?>
Python Example
Fetching the stream URL using Python requests.
import requests
channel_id = 17
api_url = f"https://tv.wasifali.tech/api/stream.php?id={channel_id}"
response = requests.get(api_url)
data = response.json()
if data.get("status"):
print("Stream URL:", data["data"]["play_url"])
else:
print("Error:", data.get("message"))
Error Codes
Our API uses standard HTTP response codes.
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request was successful |
| 400 | Bad Request | Missing required parameters |
| 403 | Forbidden | Invalid token or access denied |
| 404 | Not Found | Channel not found or inactive |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Error | Something went wrong on our end |
Sitemap API
Returns an XML sitemap of all channels, useful for SEO.
https://tv.wasifali.tech/api/sitemap.php