API

API is a special interface for developers to integrate features of our service to third-party web application. API provides tools for managing your user account – creating, receiving and managing updatable Sitemaps and RSS files. Working with the API is free for all accounts. You can enable the API and get the key in your personal account.

The access key should not be passed on to third parties or made visible in the code of web pages.

For security reasons, if you change your e-mail or password, your API key also changes.

Daily limit on the number of calls to the API - 500 requests.

If your integration algorithm requires frequent calls, we recommend that you use a local database to synchronize data, which allows queries only when necessary.

Documentation

The principle of using the API is the interaction of your application with the mysitemapgenerator.com server via the HTTP POST method.

All parameters must be passed in UTF-8 encoding. The API key must be passed as a POST variable named "api_key".

Server response comes in JSON format.

URL for sending HTTP requests:

http://www.mysitemapgenerator.com/api/{METHOD}?format=json

where {METHOD} – name of the method.

Call result

If the call is successful, the object will contain a "result" field with a value of "success".

Example of a successful method call response:

{   "result":  "success",   "source_id":  9874   }

A sign of an error when executing a method is the presence of the "result" field with the "error" value in the object. In addition, if an error occurs, the response will contain a "notice" field that contains a description of the cause of the error.

Example of an error response:

{   "result": "error", "notice": "invalid API key"   }

Your Account

getBalance
– returns the current balance of your account (for prepaid billing). A successful response will contain a field "balance".
Request:

    POST: http://www.mysitemapgenerator.com/api/getBalance?format=json HTTP/1.0\r\n
    .....
    \r\n
    api_key={yourAPIkey}

Response example:
{   "result":  "success",   "balance":  9.8   }

Updatable Sitemaps

SitemapsGetList
– returns a list of updated Sitemaps, including url and identifier ("cid" parameter) of all sites.
Request:

    POST: http://www.mysitemapgenerator.com/api/SitemapsGetList?format=json HTTP/1.0\r\n
    .....
    \r\n
    api_key={yourAPIkey}

Response example:
{
    "result":  "success",
    "resources":  [
        {"cid": 12345, "url": "http://www.mysite1.com/"},
        {"cid": 12346, "url": "http://www.mysite2.com/"}
    ]
}

SitemapsGetFiles
- returns a direct download link for a Sitemap based on the site identifier. If Sitemap consists of several files, links to all parts will be returned. Links are placed in an array "files".
Request:

    POST: http://www.mysitemapgenerator.com/api/SitemapsGetFiles?format=json HTTP/1.0\r\n
    .....
    \r\n
    api_key={yourAPIkey}&cid=12345

Response example:
{
    "result":  "success",
    "files":  [
        "http://www.mysitemapgenerator.com/?action=download&xmlfile=12345"
    ]
}

SitemapsGetInfo
– returns Sitemap info based on the site identifier. Includes current status ("work_status" parameter), indexing options ("params" array), date of last indexing in RFC 2822 ("last_scan" parameter).
Request:

    POST: http://www.mysitemapgenerator.com/api/SitemapsGetInfo?format=json HTTP/1.0\r\n
    .....
    \r\n
    api_key={yourAPIkey}&cid=12345

Response example:
{
    "result":  "success",
    "last_scan": "Mon, 02 Sep 2013 07:00:02 +0300",
    "params":  [{
        "site_url": "http://www.mysite1.com/",
        "site_noindex": 1,
        "site_nofollow": 1,
        "site_robots": 1,
        "site_forms": 0,
        "site_frames": 0,
        "site_javascripts": 0,
        "site_canonical": 0,
        "site_useragent": "default",
        "site_priority": 1,
        "site_lastmod": 1,
        "site_lastmod_source": "default",
        "site_limit": 35000,
        "site_load": "middle",
        "site_images": 0,
        "site_turbo": 1,
        "send_email": 0
    }]
}

Parameters:
site_urlWebsite URL.
site_noindex Number 0 or 1. Noindex content:
  • 0 - crawl.
  • 1 - don't crawl.
site_nofollow Number 0 or 1. Noffolow links
  • 0 - don't crawl.
  • 1 - crawl.
site_robots Number 0 or 1. Following robots.txt:
  • 0 - don't follow.
  • 1 - follow.
site_forms Number 0 or 1. Crawl HTML forms:
  • 0 - don't crawl.
  • 1 - crawl.
site_frames Number 0 or 1. Фреймы:
  • 0 - don't crawl.
  • 1 - crawl.
site_javascripts Number 0 or 1. Javascript:
  • 0 - don't crawl.
  • 1 - crawl.
site_canonical Number 0 or 1. Canonical links:
  • 0 - ignore.
  • 1 - follow & consolidate.
site_useragent String "default", "yandex", "google" or "mysitemapgenerator". Indexing Robot Headers.
  • default - browser.
  • yandex - Yandex search bot.
  • google - Google search bot.
  • mysitemapgenerator
site_priority Number 0 or 1. Priority tags:
  • 0 - don't include.
  • 1 - include.
site_lastmod Number 0 or 1. Lastmod tags:
  • 0 - don't include.
  • 1 - include.
site_lastmod_source The source of the lastmod tag is the string "server" or "default". It makes sense only with lastmod = 1.
  • server - server response.
  • default - request date.
site_limit Number 5000, 10000, 25000, 35000 or 50000. Breaking Sitemap into parts for a given number of url.
site_load String "max", "middle" or "min". Indexing Speed/Load:
  • max - maximum theads.
  • middle
  • min - minimum theads.
site_images Number 0 or 1. Google Sitemap-Image Protocol Extension:
  • 0 - off.
  • 1 - on.
site_turbo Number 0 or 1. Turbo indexing through multiple proxies:
  • 0 - off.
  • 1 - on.
send_email Number 0 or 1. Receive file to email:
  • 0 - no.
  • 1 - yes.

Updatable RSS feeds

RssGetList
– получить список обновляемых RSS, содержит url и cid канала всех сайтов.
Request:

    POST: http://www.mysitemapgenerator.com/api/RssGetList?format=json HTTP/1.0\r\n
    .....
    \r\n
    api_key={yourAPIkey}

Response example:
{
    "result":  "success",
    "resources":  [
        {"cid": 12345, "url": "http://www.mysite1.com/news/"},
        {"cid": 12346, "url": "http://www.mysite2.com/index.html"}
    ]
}

RssGetFile
- получить прямую ссылку для выгрузки RSS по идентификатору URL.
Request:

    POST: http://www.mysitemapgenerator.com/api/RssGetFile?format=json HTTP/1.0\r\n
    .....
    \r\n
    api_key={yourAPIkey}&cid=12345

Response example:
{
    "result":  "success",
    "file":  "http://www.mysitemapgenerator.com/?action=ext&file=12345"
}

RssGetInfo
– получить информацию об обновляемом RSS по его идентификатору. Возвращает текущие статус ("work_status"), параметры обновления (массив "params"), дату последней индексации сайта в формате RFC 2822 ("last_scan") и сумму списанных с баланса средств ("last_cost").
Request:

    POST: http://www.mysitemapgenerator.com/api/RssGetInfo?format=json HTTP/1.0\r\n
    .....
    \r\n
    api_key={yourAPIkey}&cid=12345

Response example:
{
    "result":  "success",
    "last_scan": "Mon, 02 Sep 2013 07:00:02 +0300",
    "params":  [{
        "found_url": "http://www.mysite1.com/news/",
        "found_mask": "",
        "items_limit": 20,
        "items_pubDate": "server",
        "channel_pubDate": "default",
        "channel_webMaster": "",
        "channel_image": "http://www.mysite1.com/logo.png",
        "encoding": "utf-8"
    }]
}

Parameters:
found_urlWeb Page URL
found_maskСтрока, представляющая собой маску для выбора ссылок на странице.
items_limit Number 10, 20, 30 or 50. Кол-во добавляемых в RSS записей.
items_pubDate Источник формирования даты публикации новости - строка "server" или "default".
  • server - из ответа сервера.
  • default - по времени запроса.
channel_webMaster Webmaster email.
channel_image Feed Logo URL.
encoding String "windows-1251" or "utf-8".

Quick start

PHP class for working with API:

See examples of using the class.