Get listings
curl --request GET \
--url https://api.treet-test.co/v1/listings \
--header 'X-Treet-Authentication-Key: <api-key>' \
--header 'X-Treet-Client-Id: <api-key>'import requests
url = "https://api.treet-test.co/v1/listings"
headers = {
"X-Treet-Client-Id": "<api-key>",
"X-Treet-Authentication-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Treet-Client-Id': '<api-key>', 'X-Treet-Authentication-Key': '<api-key>'}
};
fetch('https://api.treet-test.co/v1/listings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.treet-test.co/v1/listings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Treet-Authentication-Key: <api-key>",
"X-Treet-Client-Id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.treet-test.co/v1/listings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Treet-Client-Id", "<api-key>")
req.Header.Add("X-Treet-Authentication-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.treet-test.co/v1/listings")
.header("X-Treet-Client-Id", "<api-key>")
.header("X-Treet-Authentication-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.treet-test.co/v1/listings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Treet-Client-Id"] = '<api-key>'
request["X-Treet-Authentication-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"listings": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"state": "OPEN",
"condition": "GOOD",
"sku": "SKU325",
"availableInventory": 1,
"externalIdentifier": "SKU325-good"
}
],
"pageInfo": {
"hasNextPage": true,
"endCursor": "NTUwZTg0MDAtZTI5Yi00MWQ0LWE3MTYtNDQ2NjU1NDQwMDAw"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Listings API
Get Listings
Returns a paginated list of listings.
GET
/
v1
/
listings
Get listings
curl --request GET \
--url https://api.treet-test.co/v1/listings \
--header 'X-Treet-Authentication-Key: <api-key>' \
--header 'X-Treet-Client-Id: <api-key>'import requests
url = "https://api.treet-test.co/v1/listings"
headers = {
"X-Treet-Client-Id": "<api-key>",
"X-Treet-Authentication-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Treet-Client-Id': '<api-key>', 'X-Treet-Authentication-Key': '<api-key>'}
};
fetch('https://api.treet-test.co/v1/listings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.treet-test.co/v1/listings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Treet-Authentication-Key: <api-key>",
"X-Treet-Client-Id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.treet-test.co/v1/listings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Treet-Client-Id", "<api-key>")
req.Header.Add("X-Treet-Authentication-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.treet-test.co/v1/listings")
.header("X-Treet-Client-Id", "<api-key>")
.header("X-Treet-Authentication-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.treet-test.co/v1/listings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Treet-Client-Id"] = '<api-key>'
request["X-Treet-Authentication-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"listings": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"state": "OPEN",
"condition": "GOOD",
"sku": "SKU325",
"availableInventory": 1,
"externalIdentifier": "SKU325-good"
}
],
"pageInfo": {
"hasNextPage": true,
"endCursor": "NTUwZTg0MDAtZTI5Yi00MWQ0LWE3MTYtNDQ2NjU1NDQwMDAw"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Query Parameters
Filter by listing state.
Available options:
OPEN, CLOSED Number of listings to return per page. Must be between 1 and 200. Defaults to 50.
Required range:
1 <= x <= 200A cursor for use in pagination. after defines your place in the list. For example, if a previous response's pageInfo.endCursor was abc, set after=abc to fetch the next page.
⌘I

