Docs / Mega JSON format
Mega JSON format
Mega JSON describes a catalogue of live channels, movies and series in one file. Paste it into the Create wizard, upload it, or host it and let Smart Code fetch it on a schedule.
Samples
The smallest file the validator accepts — format, version, info.name and one live channel with one stream.
{
"format": "smartcode",
"version": 1,
"info": { "name": "My Channel" },
"live": [
{
"name": "PTV Sports",
"streams": [ { "url": "https://example.com/live/index.m3u8" } ]
}
]
}
Field overview
Section
Required
Optional
Root
format ("smartcode"), version (1), info.name, one of live / vod / series
epg, categories
info
name
provider, logo, expires_at, user_agent, headers
Category
id (whole number), name
type (live, vod, series)
Live item
name, streams[].url
id, category, logo, epg_id, number, adult, player
VOD item
name, streams[].url
id, category, poster, backdrop, year, duration_sec, rating, genre, plot, subtitles, player
Series item
name, seasons[].episodes[].streams[].url
id, category, poster, year, genre, plot; per episode: number, name, duration_sec, player
Stream
url
quality, type (hls, dash, mp4, mkv, ts, rtmp, web)
Categories
Each category has a numeric id: a whole number written without quotes, such as 1. Items point to their category by that number.
"categories": [
{ "id": 1, "name": "Cricket", "type": "live" }
],
"live": [
{ "name": "India Vs Japan", "category": 1, "streams": [ … ] }
]Player
By default Mega Player plays every stream in its own player. To open an item in a web view instead (for an embed page, for example), add "player": "webview" to that channel, movie or episode. Leave it out to keep Mega Player's own player.
{
"name": "India Vs Japan",
"category": 1,
"player": "webview",
"streams": [ { "url": "https://example.com/embed/match1", "type": "web" } ]
}Validation messages
Line 14: streams must contain at least one item
Line 22: category 7 is not defined in categories
Line 18: category id must be a whole number, like 1 (no quotes)
File exceeds 10 MB
Try it
Paste a file and we will tell you what it contains before you create a code.
Open the validator Download the complete sample