Mottor API
Search…
Сайты
get
https://api.lpmotor.ru
/v1/site
Поиск сайтов

Пример запроса

CURL
PHP CURL
PHP Guzzle
Javascript
1
curl \
2
-H "Accept: application/json" \
3
-H "Content-Type: application/json" \
4
-H "X-Api-User-Id: <<Your-user-id>>" \
5
-H "Authorization: Bearer <<Your-API-token>>" \
6
-X GET "https://api.lpmotor.ru/v1/site?type=all&sort_field=id&sort_dir=DESC&limit=18&offset=0"
Copied!
1
<?php
2
$ch = curl_init();
3
$url = 'https://api.lpmotor.ru/v1/site';
4
$param = ['type' => 'all'];
5
$url .= '?' . http_build_query($params);
6
7
curl_setopt($ch, CURLOPT_URL, $url);
8
curl_setopt(
9
$ch,
10
CURLOPT_HTTPHEADER,
11
[
12
'Host: api.lpmotor.ru',
13
'X-Api-User-Id: ' . $userId,
14
'Authorization: Bearer ' . $apiKey,
15
'Content-Type: application/json',
16
'Accept: application/json',
17
]
18
);
19
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
20
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
21
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
22
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
23
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
24
25
$result = curl_exec($ch);
26
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
27
$siteList = json_decode($result, true);
28
29
curl_close($ch);
Copied!
1
<?php
2
$client = new GuzzleHttp\Client([
3
'base_uri' => 'https://api.lpmotor.ru',
4
'headers' => [
5
'Content-Type' => 'application/json',
6
'Accept' => 'application/json',
7
'X-Api-User-Id' => $userId,
8
'Authorization' => 'Bearer ' . $apiKey,
9
],
10
]);
11
$response = $client->get(
12
'/v1/site',
13
[
14
'query' => [
15
'type' => 'all',
16
]
17
]
18
);
19
$statusCode = $response->getStatusCode();
20
$siteList = json_decode((string)$response->getBody(), true);
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 30000,
4
headers: {
5
"Content-Type" : "application/json",
6
"Accept" : "application/json",
7
"Cache-Control": "no-cache, no-store, must-revalidate",
8
"X-Api-User-Id": userId,
9
"Authorization": "Bearer " + myApiKey,
10
}
11
});
12
http.get("/v1/site", {
13
params: data
14
})
15
.then(function (response) {
16
console.log(response);
17
})
18
.catch(function (error) {
19
console.log(error);
20
});
Copied!
get
https://api.lpmotor.ru
/v1/site/{site_id}/page
Список страниц сайта

Пример запроса

CURL
PHP CURL
PHP Guzzle
Javascsript
1
curl \
2
-H "Accept: application/json" \
3
-H "Content-Type: application/json" \
4
-H "X-Api-User-Id: <<Your-user-id>>" \
5
-H "Authorization: Bearer <<Your-API-token>>" \
6
-X GET "https://api.lpmotor.ru/v1/site/<<site_id>>/page?limit=18&offset=0&with_variants=0"
Copied!
1
<?php
2
$ch = curl_init();
3
$url = 'https://api.lpmotor.ru/v1/site/' . $siteId . '/page';
4
$param = ['with_variants' => 0];
5
$url .= '?' . http_build_query($params);
6
7
curl_setopt($ch, CURLOPT_URL, $url);
8
curl_setopt(
9
$ch,
10
CURLOPT_HTTPHEADER,
11
[
12
'Host: api.lpmotor.ru',
13
'X-Api-User-Id: ' . $userId,
14
'Authorization: Bearer ' . $apiKey,
15
'Content-Type: application/json',
16
'Accept: application/json',
17
]
18
);
19
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
20
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
21
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
22
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
23
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
24
25
$result = curl_exec($ch);
26
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
27
$siteList = json_decode($result, true);
28
29
curl_close($ch);
Copied!
1
<?php
2
$client = new GuzzleHttp\Client([
3
'base_uri' => 'https://api.lpmotor.ru',
4
'headers' => [
5
'Content-Type' => 'application/json',
6
'Accept' => 'application/json',
7
'X-Api-User-Id' => $userId,
8
'Authorization' => 'Bearer ' . $apiKey,
9
],
10
]);
11
$response = $client->get(
12
'/v1/site',
13
[
14
'query' => [
15
'with_variants' => 0,
16
]
17
]
18
);
19
$statusCode = $response->getStatusCode();
20
$siteList = json_decode((string)$response->getBody(), true);
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 30000,
4
headers: {
5
"Content-Type" : "application/json",
6
"Accept" : "application/json",
7
"Cache-Control": "no-cache, no-store, must-revalidate",
8
"X-Api-User-Id": userId,
9
"Authorization": "Bearer " + myApiKey,
10
}
11
});
12
http.get("/v1/site/" + siteId + "/page", {
13
params: data
14
})
15
.then(function (response) {
16
console.log(response);
17
})
18
.catch(function (error) {
19
console.log(error);
20
});
Copied!
Last modified 3mo ago