Retrieve Multiple Tags
Returns an array of tag objects used in a space. The response includes only tags assigned to at least one story.
https://api.storyblok.com/v2/cdn/tagsQuery parameters
Section titled “Query parameters”starts_withstringFilter by the story’s
full_slugto return items starting with the given value.versionstringFilter by the story’s publication status.
filter_queryobjectLearn more in Filter Queries.
tokenrequired stringA preview or public access token configured in a space.
Response properties
Section titled “Response properties”tagsarray<Tag>An array of tag objects.
Show child properties
namestringThe tag name.
taggings_countintegerThe number of stories that include this tag.
tag_on_storiesintegerThe number of distinct stories this tag appears on (only present when all_tags parameter is true).
Examples
Section titled “Examples”curl "https://api.storyblok.com/v2/cdn/tags\?starts_with=articles%2F\&token=YOUR_ACCESS_TOKEN"// storyblok-js-client@>=7, node@>=18import Storyblok from "storyblok-js-client";
const storyblok = new Storyblok({ accessToken: "krcV6QGxWORpYLUWt12xKQtt",});
try { const response = await storyblok.get('cdn/tags', { "starts_with": "articles/" }) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->getTags([ "starts_with" => "articles/"])->getBody();HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/tags?starts_with=articles%2F&token=YOUR_ACCESS_TOKEN") .asString();var client = new RestClient("https://api.storyblok.com/v2/cdn/tags?starts_with=articles%2F&token=YOUR_ACCESS_TOKEN");var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);import requests
url = "https://api.storyblok.com/v2/cdn/tags"
querystring = {"starts_with":"articles/","token":"YOUR_ACCESS_TOKEN"}
payload = ""headers = {}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)require 'storyblok'client = Storyblok::Client.new(token: 'YOUR_TOKEN')
client.tags({:params => { "starts_with" => "articles/"}})let storyblok = URLSession(storyblok: .cdn(accessToken: "YOUR_ACCESS_TOKEN"))var request = URLRequest(storyblok: storyblok, path: "tags")request.url!.append(queryItems: [ URLQueryItem(name: "starts_with", value: "articles/")])let (data, _) = try await storyblok.data(for: request)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(Storyblok(CDN)) { accessToken = "YOUR_ACCESS_TOKEN" }}
val response = client.get("tags") { url { parameters.append("starts_with", "articles/") }}
println(response.body<JsonElement>()){"tags": [ { "name": "spicy", "taggings_count": 5 }, { "name": "red", "taggings_count": 3 }]}Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy (opens in a new window).Terms of Service (opens in a new window) apply.
Get in touch with the Storyblok community