API Documentation
This document outlines the HTTP interface that the system exposes to other applications.
Base URL
Direct all API requests to the following url: http://www.plugrush.com/api
All methods accepts both POST and GET requests. Successful requests return http code 200. Requests generating an error return http code 400.
Base Parameters
The following parameters are accepted for all requests:
- "user" - The email account you signed up for plugrush with (required)
- "api_key" - Your PlugRush API key, found in your api settings (required)
- "action" - Name of the action you are requesting. Possible actions is listed below (required)
- "method" - Can be either "json" or "xml". default is "json" (optional)
Possible actions
The following actions are available to use in API requests
- "verify"
- "category/list"
- "locales/list"
- "site/types"
- "site/list"
- "site/get"
- "site/post"
- "site/register"
- "site/verify"
- "widget/list"
- "widget/get"
- "widget/colors"
- "widget/layouts"
- "widget/create"
- "post/list"
- "post/get"
- "post/save"
- "campaign/list" (not implemented yet)
- "campaign/get" (not implemented yet)
- "campaign/ads" (not implemented yet)
- "campaign/post" (not implemented yet)
- "earnings"
"verify"
Returns success if user credentials and api_key is valid
Possible Parameters
- "type" - regular or gallery (optional. regular is default)
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=verify
Example Response
{ "message": "API key has been verified" }
"category/list"
Returns a list of categories that can be used in PlugRush
Possible Parameters
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=category/list
Example Response
{ "data": { "24": "Amateur", "25": "Anal", "26": "Ass to Mouth", "27": "Fisting", "28": "Creampie", "29": "Asian", "30": "BBW", "31": "Big Dicks", "32": "Big Tits", "33": "Blowjob", "34": "Lesbian", "116": "Arab" } }
"locales/list"
Returns a list of languages that can be used in PlugRush
Possible Parameters
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=locales/list
Example Response
{ "data": { "1": "Afrikaans", "2": "Albanian", "3": "Amharic", "13": "Arabic", "18": "Arabic", "20": "Armenian", "21": "Assamese", "23": "Azeri", "25": "Belarusian", "27": "Bengali", "28": "Bosnian", "29": "Bulgarian", "30": "Burmese", "31": "Catalan", "32": "Chinese", "37": "Croatian", "38": "Czech", "39": "Danish", "40": "Dhivehi/Maldivian", "42": "Dutch", "55": "English", "57": "Estonian", "58": "Faroese", "60": "Finnish", "66": "French", "75": "FYRO Macedonia", "79": "Georgian", "81": "German", "85": "Greek", "87": "Gujarati", "88": "Hebrew", "90": "Hungarian", "91": "Icelandic", "93": "Indonesian", "94": "Italian", "96": "Japanese", "99": "Kazakh", "101": "Korean", "102": "Kyrgyz", "103": "Lao", "105": "Latvian", "106": "Lithuanian", "108": "Malay", "110": "Maltese", "113": "Mongolian", "114": "Nepali", "115": "Norwegian", "118": "Polish", "120": "Portuguese", "124": "Romanian", "125": "Russian", "129": "Serbian", "134": "Slovak", "135": "Slovenian", "136": "Somali", "154": "Spanish", "157": "Swahili", "159": "Swedish", "161": "Tamil", "164": "Thai", "167": "Turkish", "168": "Turkmen", "169": "Ukrainian", "170": "Urdu", "172": "Uzbek", "173": "Vietnamese", "175": "Xhosa", "177": "Zulu" } }
"site/types"
Returns a list of website types that can be used in PlugRush
Possible Parameters
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=site/types
Example Response
{ "data": { "1": "Babelog", "2": "Blog", "3": "Dump", "4": "MGP", "5": "TGP", "6": "Tube" } }
"site/list"
Will return a list of all the websites in an account
Possible Parameters
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=site/list
Example Response
{ "data": [ { "id": "ID", "domain": "yourdomain.com", "status": "Active", "post_count": "20", "adzone_count": "4", "pop_enabled": 0, "mobile_enabled": 0, "adblock_enabled": 0 }, { "id": "ID", "domain": "yourotherdomain.com", "status": "Active", "post_count": "15", "adzone_count": "8", "pop_enabled": 1, "mobile_enabled": 1, "adblock_enabled": 1 }, { "id": "ID", "domain": "yourthirddomain.com", "status": "Pending", "post_count": "0", "adzone_count": "0", "pop_enabled": 0, "mobile_enabled": 0, "adblock_enabled": 0 } ] }
"site/get"
Will return info about a website
Possible Parameters
- "domain" - The domain name you are requesting (required)
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=site/get
- &domain=yourdomain.com
Example Response
{ "data": { "verification_key": "HASH", "popunder_id": "{ID}", "popunder_code": "<script src="pu.js" type="text/javascript"></script>", "popunder_alturl": "http://www.youralturl.com/pop_redirect", "popunder_limit": "1", "mobile_id": "{ID}", "mobile_code": "<script src="mobile.js" type="text/javascript"></script>", "mobile_alturl": "http://alturl.com", "adblock_id": "{ID}", "adblock_code": "<script type="text/javascript">adblock();</script>", "adblock_alturl": "", "adblock_warning": "2", "adblock_redirect": "0", "adblock_level": "2" } }
"site/post"
Will update info and settings for a website
Possible Parameters
- "domain" - The domain you are updating required
- "popunder_limit" - Pops per 24 hours per user
- "popunder_alturl" - Url to send unsold traffic to
- "mobile_alturl" - Url to send unsold traffic to
- "adblock_warning" - Toggle on or off warning to adblock users
- "adblock_redirect" - wether to redirect adblock users or not (0/1)
- "adblock_level" - 0 for level Low, 1 for level High
- "adblock_alturl" - Url to send unsold traffic to
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=site/post
- &domain=yourdomain.com
Example Response
{ "message": "Site updated successfully" }
"site/register"
Will register a new domain in your account
Possible Parameters
- "link" - URL to the website you are registering. Including http:// required
- "type_id" - Website type id. Use site/types to get a list of possible values required
- "locale_id" - Language id for the website. Use locales/list to get a list of possible values required
- "category_id" - Website category id. Use category/list to get a list of possible values required
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=site/register
- &link=http://www.yourdomain.com/
- &type_id=6
- &locale_id=134
- &category_id=134
Example Response
{ "message": "Website registered successfully", "data": { "active": 0, "domain": "yourdomain.com", "url": "http://www.yourdomain.com", "domaintype_id": "6", "locale_id": "134", "category_id": "134", "id": "ID" } }
"site/verify"
Will verify a domain by checking if the correct meta tag is included on the page
Possible Parameters
- "domain" - The domain you are verifying required
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=site/verify
- &domain=yourdomain.com
Example Response
{ "message": "Website has been verified" }
"widget/list"
Returns a list of all the widgets for a given website
Possible Parameters
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=widget/list
- &domain=yourdomain.com
Example Response
{ "data": [ { "id": "ID", "domain": "yourdomain.com", "title": "Below video player", "width": "650", "height": "250", "code": "<iframe src="http://widget.plugrush.com/yourdomain.com/ID"></iframe>" }, { "id": "ID", "domain": "yourdomain.com", "title": "Right column cube", "width": "300", "height": "250", "code": "<iframe src="http://widget.plugrush.com/yourdomain.com/ID"></iframe>" }, { "id": "ID", "domain": "yourdomain.com", "title": "Full width", "width": "985", "height": "250", "code": "<iframe src="http://widget.plugrush.com/yourdomain.com/ID"></iframe>" } ] }
"widget/get"
Will return info about a single widget
Possible Parameters
- "id" - ID of the widget being requested (required)
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=widget/get
- &id=1df3
Example Response
{ "data": { "id": "ID", "domain": "yourdomain", "title": "My widget title", "width": "300", "height": "250", "code": "<iframe allowtransparency="1" frameborder="0" height="250" id="plwpr9538450942f634e5ca5.79654774" scrolling="no" src="http://widget.plugrush.com/yourdomain/ID" width="300"></iframe>" } }
"widget/layouts"
Returns layout presets to use for creating widgets
Possible Parameters
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=widget/layouts
Example Response
{ "data": [ { "id": "1d9c", "title": "160x600", "width": "160", "height": "600", "cols": "1", "rows": "4" }, { "id": "1d9g", "title": "180x600", "width": "180", "height": "600", "cols": "1", "rows": "4" }, { "id": "1h7s", "title": "960x250", "width": "960", "height": "250", "cols": "6", "rows": "2" } ] }
"widget/colors"
Returns color presets to use for creating widgets
Possible Parameters
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=widget/colors
Example Response
{ "data": [ { "id": "1dh8", "title": "Beige and Brown" }, { "id": "1fw8", "title": "Basic Blue" }, { "id": "1fwb", "title": "Gray delight" }, { "id": "1fwi", "title": "Plugrush'ish" }, { "id": "1fwm", "title": "Google'ish" } ] }
"widget/create"
Creates a new widget based on a color and a layout preset
Possible Parameters
- "domain" - The domain you are creating a widget for (required)
- "layout_id" - ID of the layout preset to use (required)
- "color_id" - ID of the color preset to use (required)
- "title" - A title for the widget (required)
- "sell_traffic" - Whether to enable sale of clicked traffic from this widget (optional)
- "ignore_categories" - Whether to ignore selected categories for sold clicked traffic (optional)
- "sell_blind_traffic" - Whether to enable sale of blind clicked traffic from this widget (optional)
- "sell_mobile_traffic" - Whether to detect and mobile redirect traffic from this widget (optional)
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=widget/create
- &domain=yourdomain.com
- &layout_id=1dh8
- &color_id=1d9c
- &title=My widget title
- &sell_traffic=1
- &sell_blind_traffic=1
- &sell_mobile_traffic=1
- &ignore_categories=1
Example Response
{ "message": "Widget created successfully!", "data": { "id": "ID", "domain": "yourdomain", "title": "My widget title", "width": "300", "height": "250", "code": "<iframe allowtransparency="1" frameborder="0" height="250" id="plwpr9538450942f634e5ca5.79654774" scrolling="no" src="http://widget.plugrush.com/yourdomain/ID" width="300"></iframe>" } }
"post/list"
Returns a list of posts for a given domain
Possible Parameters
- "domain" - The domain you are requesting posts for (required)
- "limit" - The number of posts you want (optional, default is 50)
- "page" - Use for paginating results (optional)
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=post/list
- &domain=yourdomain.com
- &limit=50
- &page=1
Example Response
{ "data": [ { "id": "3o", "domain": "yourdomain.com", "title": "Title of the post", "description": "The post description", "link": "http://www.yourdomain.com/video/title-of-the-post", "thumbnail": "http://cdn.plugrush.com/path/to/thumb/180x135.jpg", "clicks": "244", "impressions": "780907" }, { "id": "3o", "domain": "yourdomain.com", "title": "Title of the post", "description": "The post description", "link": "http://www.yourdomain.com/video/title-of-the-post", "thumbnail": "http://cdn.plugrush.com/path/to/thumb/180x135.jpg", "clicks": "244", "impressions": "780907" }, { "id": "3o", "domain": "yourdomain.com", "title": "Title of the post", "description": "The post description", "link": "http://www.yourdomain.com/video/title-of-the-post", "thumbnail": "http://cdn.plugrush.com/path/to/thumb/180x135.jpg", "clicks": "244", "impressions": "780907" }, ] }
"post/get"
Get a single post
Possible Parameters
- "id" - The ID of the post you are requesting (required)
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=post/get
- &domain=yourdomain.com
- &id=123456
Example Response
{ "data": { "id": "123456", "status": "1", "link": "http://www.yourdomain.com/video/title-of-the-post", "title": "Title of the Post", "description": "The post description", "domain": "yourdomain.com", "impressions": "1234", "clicks": "234", "thumbnail": "http://r2.plugrush.com/path/to/thumb/180x135.jpg" } }
"post/save"
Will update a post
Possible Parameters
- "link" - The url for the post you are submitting (required)
- "title" - Title for the post you are submitting (required)
- "description" - Description for the post you are submitting (required)
- "thumbnail" - Thumbnail for the post you are submitting (required)
- "type" - 2 for gallery post, 1 for regular post
- "categories" - category id's seperated by commas
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=post/save
- &link=http://www.yourdomain.com/video/funny-man
- &title=Funny+man
- &description=A+description+for+the+plug
- &thumbnail=http://www.yourdomain.com/video/funny-man.jpg
- &type=1
- &categories=24,45,73,122
Example Response
(Not implemented yet)"campaign/list"
Returns a list of the campaigns in your account
Possible Parameters
Example Request
Example Response
(Not implemented yet)"campaign/get"
Returns details for a specific campaign
Possible Parameters
Example Request
Example Response
(Not implemented yet)"campaign/ads"
Returns all ads for a specific campaign
Possible Parameters
Example Request
Example Response
(Not implemented yet)"campaign/post"
Updates a specific campaign
Possible Parameters
Example Request
Example Response
"earnings"
Returns earnings for a given time period
Possible Parameters
- "start" - start date in the following format: Y-m-d
- "end" - end date in the following format: Y-m-d
- "domain" - optional
- "type" - Can be the following: plug, blind, popunder, mobile_redirects, adblock - optional
Example Request
- http://www.plugrush.com/api
- ?user=mail@domain.com
- &api_key=o34ting43oitfgn4ofinoi
- &action=earnings
- &start=2013-05-12
- &end=2013-05-19
- &domain=yoursite.com
- &type=mobile_redirects
Example Response
{ "data": [ { "date": "2013-05-12", "amount": 495.49 }, { "date": "2013-05-13", "amount": 428.33 }, { "date": "2013-05-14", "amount": 426.01 }, { "date": "2013-05-15", "amount": 487.28 }, { "date": "2013-05-16", "amount": 419.24 }, { "date": "2013-05-17", "amount": 522.41 }, { "date": "2013-05-18", "amount": 503.39 }, { "date": "2013-05-19", "amount": 111.09 } ] }