curl --request GET \
--url https://api-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id}', 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-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "9cdd4b69-82cb-4454-aedf-197bc3930b44",
"company_id": 1,
"cost": {
"rows": 26565354859246,
"size": 1299135691639572,
"sources": [
{
"source": {
"type": "dataset",
"dataset_id": 192
},
"rows": 26565354859246,
"size": 1299135691639572
}
]
},
"created_at": "2021-11-26T20:20:13.909581Z",
"details": {
"type": "marketplace",
"company_constraint": {
"type": "exclusion",
"company_ids": [
56
]
},
"data_rules": {
"attributes": [
{
"attribute_id": 2,
"fields": [
{
"field": "event_timestamp",
"filter": {
"recency": "P30D"
},
"exported": true
}
],
"optional": false
},
{
"attribute_id": 1,
"fields": [
{
"field": "unique_id.type",
"filter": {
"type": "include",
"list": [
"idfa",
"adid"
]
},
"exported": true
},
{
"field": "unique_id.value",
"filter": "include_only_if_not_null_filter",
"exported": true
}
],
"optional": false
},
{
"attribute_id": 11,
"fields": [
{
"field": "ip_address",
"filter": "include_only_if_not_null_filter",
"exported": true
}
],
"optional": false
}
],
"frequency_filter": {
"attribute_references": [
{
"attribute_id": 1,
"column_names": [
"unique_id.type",
"unique_id.value"
]
}
],
"min_inclusive": 2
}
},
"pricing": {
"micro_cents_usd": 10000000
}
},
"request_source": {
"type": "api_user",
"company_id": 1,
"user_id": 1
},
"subscription_id": null
}Get a cost forecast
Get a cost forecast by id.
curl --request GET \
--url https://api-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id}', 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-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/data-shops/subscriptions/cost-forecasts/{cost_forecast_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "9cdd4b69-82cb-4454-aedf-197bc3930b44",
"company_id": 1,
"cost": {
"rows": 26565354859246,
"size": 1299135691639572,
"sources": [
{
"source": {
"type": "dataset",
"dataset_id": 192
},
"rows": 26565354859246,
"size": 1299135691639572
}
]
},
"created_at": "2021-11-26T20:20:13.909581Z",
"details": {
"type": "marketplace",
"company_constraint": {
"type": "exclusion",
"company_ids": [
56
]
},
"data_rules": {
"attributes": [
{
"attribute_id": 2,
"fields": [
{
"field": "event_timestamp",
"filter": {
"recency": "P30D"
},
"exported": true
}
],
"optional": false
},
{
"attribute_id": 1,
"fields": [
{
"field": "unique_id.type",
"filter": {
"type": "include",
"list": [
"idfa",
"adid"
]
},
"exported": true
},
{
"field": "unique_id.value",
"filter": "include_only_if_not_null_filter",
"exported": true
}
],
"optional": false
},
{
"attribute_id": 11,
"fields": [
{
"field": "ip_address",
"filter": "include_only_if_not_null_filter",
"exported": true
}
],
"optional": false
}
],
"frequency_filter": {
"attribute_references": [
{
"attribute_id": 1,
"column_names": [
"unique_id.type",
"unique_id.value"
]
}
],
"min_inclusive": 2
}
},
"pricing": {
"micro_cents_usd": 10000000
}
},
"request_source": {
"type": "api_user",
"company_id": 1,
"user_id": 1
},
"subscription_id": null
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier for a cost forecast.
Response
OK
An estimate of the "cost" of servicing a set of subscription constraints.
Cost has two components:
- The number of rows which must be read in order to find data which matches the subscription constraints.
- An estimate of the "size" of those rows in bytes.
Note: the number of rows reported in the cost is not an estimate of the number of rows which will be purchased as part of a subscription using the given constraints.
Show child attributes
Show child attributes
Unique identifier for the company to which the cost forecast belongs.
ISO-8601 timestamp indicating when the cost forecast was created
The set of constraints to which the cost forecast applies.
- Option 1
- Option 2
Show child attributes
Show child attributes
Unique identifier for the cost forecast. Empty if no cost forecast was created due to the subscriptions constraints resulting in no matches.
Unique identifier of the subscription for which the cost forecast was created. Empty if the cost forecast is not associated with a subscription.
Was this page helpful?

