Mottor API
Search…
Экспорт
Метод API, который позволяет выгрузить товары из конструктора в формате в формате csv или в формате YML(Yandex Markup Language)
get
https://api.lpmotor.ru
/v1/shop/product/site/{site_id}.{file_type}

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

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/shop/product/site/11111.csv"
Copied!
1
<?php
2
$ch = curl_init();
3
4
curl_setopt($ch, CURLOPT_URL, 'https://api.lpmotor.ru/v1/shop/product/site/' . $siteId . '.csv');
5
curl_setopt(
6
$ch,
7
CURLOPT_HTTPHEADER,
8
[
9
'Host: api.lpmotor.ru',
10
'X-Api-User-Id: ' . $userId,
11
'Authorization: Bearer ' . $apiKey,
12
'Content-Type: application/json',
13
'Accept: application/json',
14
]
15
);
16
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
17
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
18
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
19
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
20
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
21
22
$result = curl_exec($ch);
23
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
24
$siteList = json_decode($result, true);
25
26
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/shop/product/site/' . $siteId . '.csv'
13
);
14
$statusCode = $response->getStatusCode();
15
$productsAsFile = json_decode((string) $response->getBody(), true);
Copied!
1
http = Axios.create({
2
baseURL: "https://api.lpmotor.ru",
3
timeout: 60000,
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/shop/product/site/" + siteId + ".csv");
Copied!

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

Copy link
Contents
get