Market Collections
curl --request GET \
--url https://api.forestreet.com/markets/collectionsimport requests
url = "https://api.forestreet.com/markets/collections"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.forestreet.com/markets/collections', 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.forestreet.com/markets/collections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.forestreet.com/markets/collections"
req, _ := http.NewRequest("GET", url, nil)
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.forestreet.com/markets/collections")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.forestreet.com/markets/collections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"meta": {
"totalItems": 2
},
"collections": [
{
"id": 411,
"name": "Staging Markets",
"description": "A collection of all unverified markets; this is the default location for all new markets.",
"createdDate": "2022-12-11T10:09:08.000Z",
"isDefault": 1
},
{
"id": 123,
"name": "Verified Market Archives",
"description": "A collection of all manually validated markets.",
"createdDate": "2022-01-01T02:03:04.000Z",
"isDefault": 0
}
]
}
Markets
Market Collections
Get all the collections that the current user is allowed to access.
GET
/
markets
/
collections
Market Collections
curl --request GET \
--url https://api.forestreet.com/markets/collectionsimport requests
url = "https://api.forestreet.com/markets/collections"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.forestreet.com/markets/collections', 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.forestreet.com/markets/collections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.forestreet.com/markets/collections"
req, _ := http.NewRequest("GET", url, nil)
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.forestreet.com/markets/collections")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.forestreet.com/markets/collections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"meta": {
"totalItems": 2
},
"collections": [
{
"id": 411,
"name": "Staging Markets",
"description": "A collection of all unverified markets; this is the default location for all new markets.",
"createdDate": "2022-12-11T10:09:08.000Z",
"isDefault": 1
},
{
"id": 123,
"name": "Verified Market Archives",
"description": "A collection of all manually validated markets.",
"createdDate": "2022-01-01T02:03:04.000Z",
"isDefault": 0
}
]
}
A user can include markets in a market collection to categorise their list of markets they have access to. Any market
can only exists in a single collection at a time, and each user starts with a default collection that all markets will
belong to by default.
Collections are useful for users to group markets together for specific purposes, for example:
- markets that are generated for a specific project,
- markets that are reviewed by QA team,
- markets that are archived due to change in business needs.
collectionId query parameter in selected endpoints to filter your results to the
given collection.
Response
{
"meta": {
"totalItems": 2
},
"collections": [
{
"id": 411,
"name": "Staging Markets",
"description": "A collection of all unverified markets; this is the default location for all new markets.",
"createdDate": "2022-12-11T10:09:08.000Z",
"isDefault": 1
},
{
"id": 123,
"name": "Verified Market Archives",
"description": "A collection of all manually validated markets.",
"createdDate": "2022-01-01T02:03:04.000Z",
"isDefault": 0
}
]
}
An array of collections.Default endpoint will always be the first item, with the rest sorted by their
*creation dates in ascending order.