curl --request GET \
--url https://api-dev.narrative.io/data-shops/subscriptions/{subscription_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/data-shops/subscriptions/{subscription_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/{subscription_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/{subscription_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/{subscription_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/{subscription_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/data-shops/subscriptions/{subscription_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{
"read_once": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"budget": {
"amount": {
"currency": "USD",
"value": 123
},
"period": {
"type": "calendar_daily"
}
},
"company_id": 123,
"created_at": "<string>",
"name": "<string>",
"status": "active",
"updated_at": "<string>",
"cancelled_at": "<string>",
"description": "<string>",
"details": {
"type": "data_stream",
"data_rules": {
"column_sets": [
{
"dataset_id": 123,
"fields": [
{
"field": "/id/value",
"exported": true,
"filter": "include_all_values_including_nulls_filter"
}
]
}
],
"attributes": [
{
"attribute_id": 123,
"fields": [
{
"field": "/id/value",
"exported": true,
"filter": "include_all_values_including_nulls_filter"
}
],
"optional": true
}
],
"deduplication": {
"period": "<string>",
"column_references": [
{
"dataset_id": 123,
"column_names": [
"/id/value"
]
}
],
"attribute_references": [
{
"attribute_id": 123,
"column_names": [
"/id/value"
]
}
]
},
"frequency_filter": {
"column_references": [
{
"dataset_id": 123,
"column_names": [
"/id/value"
]
}
],
"attribute_references": [
{
"attribute_id": 123,
"column_names": [
"/id/value"
]
}
],
"min_inclusive": 123,
"max_inclusive": 123
},
"dataset_filter": {
"dataset_id": 123,
"attribute": {
"attribute_id": 123,
"field": "/id/value"
},
"inclusion": "include"
}
},
"data_shop_id": "<string>",
"data_stream_company_id": 123,
"data_stream_content": {
"description": "<string>",
"icon": "<string>",
"sections": [
{}
]
},
"data_stream_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data_stream_name": "<string>",
"data_stream_slug": "<string>",
"offer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "data_streams_market",
"licensing": {
"period": "<string>",
"license": {
"id": "7fe746ee-6b71-4130-af40-41fd7e7ba7eb"
}
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 123
},
"shops": [
"<string>"
]
}
},
"output": {
"dataset_id": 123
},
"cadence": "once"
}Get a subscription
Get a subscription by id.
curl --request GET \
--url https://api-dev.narrative.io/data-shops/subscriptions/{subscription_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/data-shops/subscriptions/{subscription_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/{subscription_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/{subscription_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/{subscription_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/{subscription_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/data-shops/subscriptions/{subscription_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{
"read_once": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"budget": {
"amount": {
"currency": "USD",
"value": 123
},
"period": {
"type": "calendar_daily"
}
},
"company_id": 123,
"created_at": "<string>",
"name": "<string>",
"status": "active",
"updated_at": "<string>",
"cancelled_at": "<string>",
"description": "<string>",
"details": {
"type": "data_stream",
"data_rules": {
"column_sets": [
{
"dataset_id": 123,
"fields": [
{
"field": "/id/value",
"exported": true,
"filter": "include_all_values_including_nulls_filter"
}
]
}
],
"attributes": [
{
"attribute_id": 123,
"fields": [
{
"field": "/id/value",
"exported": true,
"filter": "include_all_values_including_nulls_filter"
}
],
"optional": true
}
],
"deduplication": {
"period": "<string>",
"column_references": [
{
"dataset_id": 123,
"column_names": [
"/id/value"
]
}
],
"attribute_references": [
{
"attribute_id": 123,
"column_names": [
"/id/value"
]
}
]
},
"frequency_filter": {
"column_references": [
{
"dataset_id": 123,
"column_names": [
"/id/value"
]
}
],
"attribute_references": [
{
"attribute_id": 123,
"column_names": [
"/id/value"
]
}
],
"min_inclusive": 123,
"max_inclusive": 123
},
"dataset_filter": {
"dataset_id": 123,
"attribute": {
"attribute_id": 123,
"field": "/id/value"
},
"inclusion": "include"
}
},
"data_shop_id": "<string>",
"data_stream_company_id": 123,
"data_stream_content": {
"description": "<string>",
"icon": "<string>",
"sections": [
{}
]
},
"data_stream_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data_stream_name": "<string>",
"data_stream_slug": "<string>",
"offer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "data_streams_market",
"licensing": {
"period": "<string>",
"license": {
"id": "7fe746ee-6b71-4130-af40-41fd7e7ba7eb"
}
},
"pricing": {
"type": "per_record",
"micro_cents_usd": 123
},
"shops": [
"<string>"
]
}
},
"output": {
"dataset_id": 123
},
"cadence": "once"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier for a subscription.
Response
OK
Whether a row is bought at most once. When true the subscription skips rows it has already purchased on an earlier run; when false the same row can be bought again.
Unique identifier for the subscription.
The maximum amount that can be spent as part of a subscription in a given time period. Once the budget has been exhausted in a given time period no more data is transacted until the start of the next one.
E.g. with a budget of $100 USD and a period of calendar_monthly you're guaranteed that you will not be charged more than $100 for your subscription in a given month.
Show child attributes
Show child attributes
Unique identifier for the company to which the subscription belongs.
ISO-8601 timestamp indicating when the subscription rule was created.
A human-friendly name for the subscription.
The current state of the subscription.
active: the subscription is active, data is being purchased regularly.cancelled: the subscription has been cancelled, but not deleted.pending: the subscription has been created but is not yet active, not data is being purchased as part of the subscription.kickoff: the subscription is kicking off (immediate run) prior to activation.completed: the subscription as run once as requested and is completed.
active, cancelled, pending, archived, kickoff, completed ISO-8601 timestamp indicating when the subscription rule was created.
ISO-8601 timestamp indicating when the subscription was cancelled. Null while the subscription has not been cancelled.
A human-friendly description of the subscription.
- Option 1
- Option 2
Show child attributes
Show child attributes
The delivery dataset. Null until the subscription has produced one.
Show child attributes
Show child attributes
The cadence at which the subscription will be executed.
once: the subscription will run only once.hourly: the subscription run every hour.daily: the subscription run once per day.weekly: the subscription run once per week.monthly: the subscription run once per month.
once, hourly, daily, weekly, monthly Was this page helpful?

