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.
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.
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" }
getBalance
– возвращает доступный остаток средств на балансе (в USD). Успешный ответ будет содержать поле "balance".
Запрос:
POST: http://www.mysitemapgenerator.com/api/getBalance?format=json HTTP/1.0\r\n
.....
\r\n
api_key={yourAPIkey}
{ "result": "success", "balance": 9.8 }
SitemapsGetList
– получить список обновляемых Sitemaps, содержит url и идентификатор (параметр "cid") для всех сайтов.
Запрос:
POST: http://www.mysitemapgenerator.com/api/SitemapsGetList?format=json HTTP/1.0\r\n
.....
\r\n
api_key={yourAPIkey}
{ "result": "success", "resources": [ {"cid": 12345, "url": "http://www.mysite1.com/"}, {"cid": 12346, "url": "http://www.mysite2.com/"} ] }
SitemapsGetFiles
- получить прямую ссылку для выгрузки Sitemap по идентификатору сайта. Если Sitemap разбит на части будут возвращены ссылки на все связанные файлы. Ссылки помещаются в массив "files".
Запрос:
POST: http://www.mysitemapgenerator.com/api/SitemapsGetFiles?format=json HTTP/1.0\r\n ..... \r\n api_key={yourAPIkey}&cid=12345
{ "result": "success", "files": [ "http://www.mysitemapgenerator.com/?action=download&xmlfile=12345" ] }
SitemapsGetInfo
– получить информацию об обновляемом Sitemap по идентификатору сайта. Возвращает текущие статус ("work_status"), параметры индексации сайта (массив "params"), дату последней индексации в формате RFC 2822 ("last_scan").
Запрос:
POST: http://www.mysitemapgenerator.com/api/SitemapsGetInfo?format=json HTTP/1.0\r\n ..... \r\n api_key={yourAPIkey}&cid=12345
{ "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 }] }
site_url | URL сайта. |
site_noindex |
Число 0 или 1. Содержимое noindex:
|
site_nofollow |
Число 0 или 1. Ссылки с noffolow
|
site_robots |
Число 0 или 1. Интсрукции robots.txt:
|
site_forms |
Число 0 или 1. Формы:
|
site_frames |
Число 0 или 1. Фреймы:
|
site_javascripts |
Число 0 или 1. Javascript:
|
site_canonical |
Число 0 или 1. Канонические ссылки:
|
site_useragent |
Строка "default", "yandex", "google" или "mysitemapgenerator". Определяет способ идентификации нашего робота.
|
site_priority |
Число 0 или 1. Тег priority:
|
site_lastmod |
Число 0 или 1. Тег lastmod:
|
site_lastmod_source |
Источник формирования тега lastmod - строка "server" или "default". Имеет смысл только при lastmod=1.
|
site_limit | Число 5000, 10000, 25000, 35000 или 50000. Разбивать Sitemap на части по заданому кол-ву url. |
site_load |
Строка "max", "middle" или "min". Скорость/нагрузка при индексации:
|
site_images |
Число 0 или 1. Расширение протокола Google Sitemap-Image:
|
site_turbo |
Число 0 или 1. Режим Турбо:
|
send_email |
Число 0 или 1. Отправлять по Email:
|
RssGetList
– получить список обновляемых RSS, содержит url и cid канала всех сайтов.
Запрос:
POST: http://www.mysitemapgenerator.com/api/RssGetList?format=json HTTP/1.0\r\n
.....
\r\n
api_key={yourAPIkey}
{ "result": "success", "resources": [ {"cid": 12345, "url": "http://www.mysite1.com/news/"}, {"cid": 12346, "url": "http://www.mysite2.com/index.html"} ] }
RssGetFile
- получить прямую ссылку для выгрузки RSS по идентификатору URL.
Запрос:
POST: http://www.mysitemapgenerator.com/api/RssGetFile?format=json HTTP/1.0\r\n ..... \r\n api_key={yourAPIkey}&cid=12345
{ "result": "success", "file": "http://www.mysitemapgenerator.com/?action=ext&file=12345" }
RssGetInfo
– получить информацию об обновляемом RSS по его идентификатору. Возвращает текущие статус ("work_status"), параметры обновления (массив "params"), дату последней индексации сайта в формате RFC 2822 ("last_scan") и сумму списанных с баланса средств ("last_cost").
Запрос:
POST: http://www.mysitemapgenerator.com/api/RssGetInfo?format=json HTTP/1.0\r\n ..... \r\n api_key={yourAPIkey}&cid=12345
{ "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" }] }
found_url | URL страницы. |
found_mask | Строка, представляющая собой маску для выбора ссылок на странице. |
items_limit | Число 10, 20, 30 или 50. Кол-во добавляемых в RSS записей. |
items_pubDate |
Источник формирования даты публикации новости - строка "server" или "default".
|
channel_webMaster | E-mail веб-мастера. |
channel_image | URL логотипа. |
encoding | Строка "windows-1251" или "utf-8". |
PHP class for working with API:
Download (29.08.2014)
Online Services
Customer Info
About Us