Gilraen Data API
API Endpoint
https://api.gilraen.bizИспользуя данный API вы можете получить доступ к обезличенной информации о телефонных номерах — рейтингу доверия, количеству блокировок, тегах присвоенных номеру, количеству отзывов, региону и оператору номера.
Для работы с API необходимо получить ключ доступа. Более подробно про условия и тарифы вы можете узнать на https://gilraen.biz
Общая информация
Домен — https://api.gilraen.biz
Все запросы к API подписываются сигнатурой:
- к параметрам запроса добавляется:
- timestamp = текущее время в формате Unix
- signature = рассчет описан далее
Расчет Сигнатуры
-
формируем строку
method+host+url+params+secretгде:method=GET— метод запросаhost=api.gilraen.biz— хостurl=/api/preview/v1/limits— урл запрашиваемого методаparams=key=nO0hy3rrzaCP9VPz8cPnCe1eyc5wiAjM3dAp2U38MB02lQmclm×tamp=1616541199отсортированные по алфавиту параметры запроса (и query и body вместе) за исключениемsignatureтакже параметры должны пройти нормализацию в соответствии с RFC 3986 (url_encode)secret=test— секретный пароль (участвует в генреации сигнатуры, но не передается)
-
кодируем строку sha256
- пример сторки
GETapi.gilraen.biz/v1/limitskey=nO0hy3rrzaCP9VPz8cPnCe1eyc5wiAjM3dAp2U38MB02lQmclm×tamp=1616541199test - пример результата
ddb8e8062e93d3fca4c3a624b770a29d8f4ce59c270803163c101a21b4bd5fd1
- пример сторки
Лимиты
Запросы к API ограничены лимитом в соответствии с тарифом (кроме запроса на просмотр лимита)
Методы ¶
Лимиты ¶
Headers
Content-Type: application/jsonBody
{
"status_code": 0,
"status": "success",
"message": "",
"data": {
"limits": 354
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "number"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"object",
"null"
],
"properties": {
"limits": {
"type": "number"
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "401",
"status": "Unauthorized",
"message": "Unauthorized or limit used up",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "419",
"status": "signature error",
"message": "signature failed verification",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}ЛимитыGET/v1/limits?timestamp={timestamp}&key={key}&signature={signature}
Лимиты на обращения к API.
- key
string(required) Example: nO0hy3rrzaCP9VPz8cPnCe1eyc5wiAjM3dAp2U38MB02lключ API
- timestamp
number(required) Example: 1616541199отметка времени
- signature
string(required) Example: ddb8e8062e93d3fca4c3a624b770a29d8f4ce59c270803163c101a21b4bd5fd1сигнатура запроса
Рейтинг доверия ¶
Headers
Content-Type: application/jsonBody
{
"status_code": 0,
"status": "success",
"message": "",
"data": {
"index": 6.45
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "number"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"object",
"null"
],
"properties": {
"index": {
"type": "number"
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "401",
"status": "Unauthorized",
"message": "Unauthorized or limit used up",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "419",
"status": "signature error",
"message": "signature failed verification",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Рейтинг доверияGET/v1/index?timestamp={timestamp}&key={key}&number={number}&signature={signature}
Рейтинг доверия к номеру телефона
Диапазон значений 0.00 .. 10.00 Значение по умолчанию - 5.00
- key
string(required) Example: nO0hy3rrzaCP9VPz8cPnCe1eyc5wiAjM3dAp2U38MB02lключ API
- number
number(required) Example: 79991234567номер телефона в формате e.164
- timestamp
number(required) Example: 1616541199отметка времени
- signature
string(required) Example: ddb8e8062e93d3fca4c3a624b770a29d8f4ce59c270803163c101a21b4bd5fd1сигнатура запроса
Блокировки ¶
Headers
Content-Type: application/jsonBody
{
"status_code": 0,
"status": "success",
"message": "",
"data": {
"bans": 145
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "number"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"object",
"null"
],
"properties": {
"bans": {
"type": "number"
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "401",
"status": "Unauthorized",
"message": "Unauthorized or limit used up",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "419",
"status": "signature error",
"message": "signature failed verification",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}БлокировкиGET/v1/bans?timestamp={timestamp}&key={key}&number={number}&signature={signature}
Счетчик банов номера телефона
- key
string(required) Example: nO0hy3rrzaCP9VPz8cPnCe1eyc5wiAjM3dAp2U38MB02lключ API
- number
number(required) Example: 79991234567номер телефона в формате e.164
- timestamp
number(required) Example: 1616541199отметка времени
- signature
string(required) Example: ddb8e8062e93d3fca4c3a624b770a29d8f4ce59c270803163c101a21b4bd5fd1сигнатура запроса
Топ тегов ¶
Headers
Content-Type: application/jsonBody
{
"status_code": 0,
"status": "success",
"message": "",
"data": {
"tags": {
"callerType": {
"id": 11,
"count": 11
},
"categories": [
{
"id": 1146,
"count": 245
},
{
"id": 1144,
"count": 159
}
],
"subcategories": [
{
"id": 10036,
"count": 154
},
{
"id": 10037,
"count": 4
}
],
"callReasons": [
{
"id": 100009,
"count": 156
},
{
"id": 100006,
"count": 150
}
],
"emotags": [
{
"id": 200003,
"count": 4041
}
]
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "number"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"object",
"null"
],
"properties": {
"tags": {
"type": "object",
"properties": {
"callerType": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"count": {
"type": "number"
}
}
},
"categories": {
"type": "array"
},
"subcategories": {
"type": "array"
},
"callReasons": {
"type": "array"
},
"emotags": {
"type": "array"
}
}
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "401",
"status": "Unauthorized",
"message": "Unauthorized or limit used up",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "419",
"status": "signature error",
"message": "signature failed verification",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Топ теговGET/v1/tags_top?timestamp={timestamp}&key={key}&number={number}&signature={signature}
Топ тегов по типам. До 5 штук в каждой категории
- key
string(required) Example: nO0hy3rrzaCP9VPz8cPnCe1eyc5wiAjM3dAp2U38MB02lключ API
- number
number(required) Example: 79991234567номер телефона в формате e.164
- timestamp
number(required) Example: 1616541199отметка времени
- signature
string(required) Example: ddb8e8062e93d3fca4c3a624b770a29d8f4ce59c270803163c101a21b4bd5fd1сигнатура запроса
Флаг "Нежелательные звонки" ¶
Headers
Content-Type: application/jsonBody
{
"status_code": 0,
"status": "success",
"message": "",
"data": {
"is_unwanted": false
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "number"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"object",
"null"
],
"properties": {
"is_unwanted": {
"type": "boolean"
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "401",
"status": "Unauthorized",
"message": "Unauthorized or limit used up",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "419",
"status": "signature error",
"message": "signature failed verification",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Флаг "Нежелательные звонки"GET/v1/unwanted?timestamp={timestamp}&key={key}&number={number}&signature={signature}
- key
string(required) Example: nO0hy3rrzaCP9VPz8cPnCe1eyc5wiAjM3dAp2U38MB02lключ API
- number
number(required) Example: 79991234567номер телефона в формате e.164
- timestamp
number(required) Example: 1616541199отметка времени
- signature
string(required) Example: ddb8e8062e93d3fca4c3a624b770a29d8f4ce59c270803163c101a21b4bd5fd1сигнатура запроса
Оператор и регион ¶
Headers
Content-Type: application/jsonBody
{
"status_code": 0,
"status": "success",
"message": "",
"data": {
"carrier": "ПАО \"МегаФон\"",
"region": "Россия, Краснодарский край"
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "number"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"object",
"null"
],
"properties": {
"carrier": {
"type": "string"
},
"region": {
"type": "string"
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "401",
"status": "Unauthorized",
"message": "Unauthorized or limit used up",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "419",
"status": "signature error",
"message": "signature failed verification",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Оператор и регионGET/v1/carrier_region?timestamp={timestamp}&key={key}&number={number}&signature={signature}
- key
string(required) Example: nO0hy3rrzaCP9VPz8cPnCe1eyc5wiAjM3dAp2U38MB02lключ API
- number
number(required) Example: 79991234567номер телефона в формате e.164
- timestamp
number(required) Example: 1616541199отметка времени
- signature
string(required) Example: ddb8e8062e93d3fca4c3a624b770a29d8f4ce59c270803163c101a21b4bd5fd1сигнатура запроса
Количество отзывов ¶
Headers
Content-Type: application/jsonBody
{
"status_code": 0,
"status": "success",
"message": "",
"data": {
"comments_count": 5
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "number"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"object",
"null"
],
"properties": {
"comments_count": {
"type": "number"
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "401",
"status": "Unauthorized",
"message": "Unauthorized or limit used up",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "419",
"status": "signature error",
"message": "signature failed verification",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Количество отзывовGET/v1/comments?timestamp={timestamp}&key={key}&number={number}&signature={signature}
- key
string(required) Example: nO0hy3rrzaCP9VPz8cPnCe1eyc5wiAjM3dAp2U38MB02lключ API
- number
number(required) Example: 79991234567номер телефона в формате e.164
- timestamp
number(required) Example: 1616541199отметка времени
- signature
string(required) Example: ddb8e8062e93d3fca4c3a624b770a29d8f4ce59c270803163c101a21b4bd5fd1сигнатура запроса
Словарь тегов ¶
Headers
Content-Type: application/jsonBody
{
"status_code": 0,
"status": "success",
"message": "",
"data": {
"tagsList": [
{
"type": "CALLER_TYPE",
"id": 10,
"name": "Person"
},
{
"type": "CATEGORY",
"id": 1145,
"name": "Transport"
},
{
"type": "SUBCATEGORY",
"id": 10041,
"name": "Taxi"
},
{
"type": "CALL_REASON",
"id": 100009,
"name": "SPAM"
},
{
"type": "EMOTAG",
"id": 200000,
"name": "Like"
}
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "number"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"object",
"null"
],
"properties": {
"tagsList": {
"type": "array"
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "401",
"status": "Unauthorized",
"message": "Unauthorized or limit used up",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "419",
"status": "signature error",
"message": "signature failed verification",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Словарь теговGET/v1/tags_list?timestamp={timestamp}&key={key}&signature={signature}
Список возможных тегов.
Уникальный ключ — type + id (в рамках одного type не могут повторяться id)
Возможные типы:
-
CALLER_TYPE -
CATEGORY -
SUBCATEGORY -
CALL_REASON -
EMOTAG
- key
string(required) Example: nO0hy3rrzaCP9VPz8cPnCe1eyc5wiAjM3dAp2U38MB02lключ API
- timestamp
number(required) Example: 1616541199отметка времени
- signature
string(required) Example: ddb8e8062e93d3fca4c3a624b770a29d8f4ce59c270803163c101a21b4bd5fd1сигнатура запроса
Комбинированный метод ¶
Headers
Content-Type: application/jsonBody
{
"status_code": 0,
"status": "success",
"message": "",
"data": {
"bans": 145,
"index": 6.45,
"is_unwanted": false
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "number"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"object",
"null"
],
"properties": {
"bans": {
"type": "number"
},
"index": {
"type": "number"
},
"is_unwanted": {
"type": "boolean"
}
}
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "401",
"status": "Unauthorized",
"message": "Unauthorized or limit used up",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Headers
Content-Type: application/jsonBody
{
"status_code": "419",
"status": "signature error",
"message": "signature failed verification",
"data": ""
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status_code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": [
"string",
"null"
]
},
"data": {
"type": [
"string",
"null"
]
}
}
}Комбинированный методGET/v1/number?timestamp={timestamp}&key={key}&number={number}&opt_fields={opt_fields}&signature={signature}
Метод отдает набор данных о номере в одном запросе. Каждое поле, кроме limits, потребляет единицу лимита.
Примеры:
-
opt_fields=bans,index,tags_top,unwanted,commentsтратит 5 единиц лимита. -
opt_fields=indexтратит 1 единицу лимита.
При недостаточном лимите на запросы вернется ошибка.
- key
string(required) Example: nO0hy3rrzaCP9VPz8cPnCe1eyc5wiAjM3dAp2U38MB02lключ API
- number
number(required) Example: 79991234567номер телефона в формате e.164
- opt_fields
string(required) Example: bans,index,unwantedсписок желаемых параметров через запятую
-
bans
-
index
-
tags_top
-
unwanted
-
comments
-
limits
-
carrier_region
-
- timestamp
number(required) Example: 1616541199отметка времени
- signature
string(required) Example: ddb8e8062e93d3fca4c3a624b770a29d8f4ce59c270803163c101a21b4bd5fd1сигнатура запроса
Generated by aglio on 07 Jun 2021