Custom API (Application Programming Interface)


Custom API and its satellites offer many standard bases for api calls. For example:


However, if you are frequent user of, you might want to tune those pages with your custom settings (like own site avatar), or even to map it on your own (sub)domain name.

Below you will find detailed instructions on how one can create those custom bases.

1. Register any site on any service

1.a. Go to or or any other

1.b. Follow the standard procedure; provide your email, password, site name (let us say that for this example we will create site

1.c. If requested, confirm your account by email.

2. Set up the API page

2.a. Login to your site admin panel, e.g.:

2.b. Select as the theme:

Appearance > Theme > > Activate

2.c. In the theme options enable auxiliary tabs and customise the colours

Appearance > Theme Settings > Menu Layout

> Set Auxiliary Tabs to Public; you can hide the other tabs or make them private

> Set the code tabs’ source in “Tabs’ & Feed’s Sources” to Feed if you want to hook your API on RSS (make sure that the Core Tabs are set Public in such a case)

> You can also change the colours in the “Menu Colour Scheme” section

2.d. Upload site avatar

Appearance> Site Avatar

2.e. Delete default sites

My Sites > Edit

> Remove all default sites and press “Save changes” button

2.e Change site title and description

Site Settings > General

You are nearly done.

2.f. If you want, you can map the new API site on your own (sub)domain:

Tools> Domain Mapping

So that instead of you will be calling say  Find more instructions in the Domain Mapping section.

Now you have your own API base set up.

3. API Calls

Another advanced step is to generate links to your API base on the fly. The following php code creates such a link from the URLs stored in $entry_array:

$n = count ( $entry_array );

$p = '';
for ( $i=0; $i<$n; $i++ ) {
  if ( $s = trim ( $entry_array [$i] ) ) {
    $p .= '&url' . ($i+1) . '=' . urlencode ( $s  ) .
          '&caption' . ($i+1) . '=' . urlencode ( 'Item ' . ($i+1) );

if ( $p ) {
  echo '<p>Link to open all URLs with one click:</p>' . "\n";
  $l = '' . urlencode ( 'ToC' ) . $p;
  echo '<a href="' . $l . '" target="_blank">' . $l . '</a>';

You can reuse this code to take your data source and to link to your API page.

Important: make sure you pass all parameters using urlencode. This is required for all special characters, including Chinese, Cyrillic, Thai letters etc.

Important: some browsers, namely, Internet Explorer (even 64 bit version 9) and Windows version of Safari cut the URLs longer than 2000 characters. To aviod the lose of any added parameters please check the URLs before sharing, and use on-the-fly URL shorteners (see another example here).

It is also possible to prevent embedding foreign links by white listing your own domain name. Just go to:

Appearance > Theme Settings > API Settings

and list those you want to enable. If the white list is not left blank, all other auxiliary links will be rejected.

4. Extra

If you enable the Analytics or provide your Google Analytics code, you will be able to monitor who is visiting your API calls too.

Additional notes


Open all references in tabs: [1 – 9]

Short link: [Facebook] [Twitter] [Email] Copy -$CO