gt_int
Returns all stories with a field value greater than the provided value.
This operation can be used for Number fields or Text fields with an integer value. Moreover, it can be used for custom fields returning an integer value.
Examples Use Cases
Section titled “Examples Use Cases”filter_query[price][gt_int]=120
Returns all stories with a price greater than 120.
filter_query[price][gt_int]=1200
Returns all stories with a price greater than 1200. Please note the absence of a thousand separator.
Example Request and Response
Section titled “Example Request and Response”The following example demonstrates how to receive all stories with a price greater than 1200 using the gt_int operation.
curl "https://api.storyblok.com/v2/cdn/stories/\?filter_query%5Bprice%5D%5Bgt_int%5D=1200\&token=ask9soUkv02QqbZgmZdeDAtt"// storyblok-js-client@>=7, node@>=18import Storyblok from "storyblok-js-client";
const storyblok = new Storyblok({ accessToken: "krcV6QGxWORpYLUWt12xKQtt",});
try { const response = await storyblok.get('cdn/stories/', { "filter_query[price][gt_int]": "1200"}) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->getStories([ "filter_query[price][gt_int]" => "1200"])->getBody();HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/stories/?filter_query%5Bprice%5D%5Bgt_int%5D=1200&token=ask9soUkv02QqbZgmZdeDAtt") .asString();var client = new RestClient("https://api.storyblok.com/v2/cdn/stories/?filter_query%5Bprice%5D%5Bgt_int%5D=1200&token=ask9soUkv02QqbZgmZdeDAtt");var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);import requests
url = "https://api.storyblok.com/v2/cdn/stories/"
querystring = {"filter_query[price][gt_int]":"1200","token":"ask9soUkv02QqbZgmZdeDAtt"}
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.stories({:params => { "filter_query[price][gt_int]" => "1200"}})let storyblok = URLSession(storyblok: .cdn(accessToken: "ask9soUkv02QqbZgmZdeDAtt"))var request = URLRequest(storyblok: storyblok, path: "stories/")request.url!.append(queryItems: [ URLQueryItem(name: "filter_query[price][gt_int]", value: "1200")])let (data, _) = try await storyblok.data(for: request)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(Storyblok(CDN)) { accessToken = "ask9soUkv02QqbZgmZdeDAtt" }}
val response = client.get("stories/") { url { parameters.append("filter_query[price][gt_int]", "1200") }}
println(response.body<JsonElement>()){ "stories": [ { "name": "Product B", "created_at": "2024-03-07T15:43:12.008Z", "published_at": "2024-03-07T15:49:22.518Z", "id": 457608238, "uuid": "278b829e-bde6-48e3-9920-f99d3afe35d3", "content": { "_uid": "2fe813f5-e86a-4f56-a4ea-e9a9bfdc354c", "image": { "id": null, "alt": null, "name": "", "focus": null, "title": null, "source": null, "filename": "", "copyright": null, "fieldtype": "asset", "meta_data": {} }, "price": "1800", "component": "product" }, "slug": "product-b", "full_slug": "products/product-b", "sort_by_date": null, "position": 0, "tag_list": [], "is_startpage": false, "parent_id": 457608232, "meta_data": null, "group_id": "bb986ccd-3ad7-448b-9662-27ff49aa7bff", "first_published_at": "2024-03-07T15:42:52.308Z", "release_id": null, "lang": "default", "path": null, "alternates": [], "default_full_slug": null, "translated_slugs": null } ], "cv": 1709826564, "rels": [], "links": []}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