Get Popular Markets
curl --request GET \
--url https://api.entityml.com/api/v1/stats/popular-marketsimport requests
url = "https://api.entityml.com/api/v1/stats/popular-markets"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.entityml.com/api/v1/stats/popular-markets', 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.entityml.com/api/v1/stats/popular-markets",
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.entityml.com/api/v1/stats/popular-markets"
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.entityml.com/api/v1/stats/popular-markets")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.entityml.com/api/v1/stats/popular-markets")
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{
"top_markets": [
{}
]
}Analytics
Get Popular Markets
Return the most frequently queried markets over a lookback window.
GET
/
api
/
v1
/
stats
/
popular-markets
Get Popular Markets
curl --request GET \
--url https://api.entityml.com/api/v1/stats/popular-marketsimport requests
url = "https://api.entityml.com/api/v1/stats/popular-markets"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.entityml.com/api/v1/stats/popular-markets', 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.entityml.com/api/v1/stats/popular-markets",
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.entityml.com/api/v1/stats/popular-markets"
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.entityml.com/api/v1/stats/popular-markets")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.entityml.com/api/v1/stats/popular-markets")
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{
"top_markets": [
{}
]
}Request
integer
Number of markets to return. Default:
20. Max: 100.integer
Lookback window in days. Default:
30. Max: 365.Response
array
Array of
{ condition_id, request_count } rows.Example
from entityml import EntityMLClient
client = EntityMLClient()
popular = client.analytics.get_popular_markets(limit=10, days=7)
print(popular["top_markets"])
entityml analytics popular-markets --limit 10 --days 7
curl "https://api.entityml.com/api/v1/stats/popular-markets?limit=10&days=7"
Example response
{
"days": 7,
"total_unique_markets": 150,
"top_markets": [
{
"condition_id": "0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4",
"request_count": 82
}
]
}
⌘I