Skip navigation

Get content items

While your copywriters draft articles and add finishing touches to the content in your project, you can deliver that content to web and mobile applications via an API. Learn how to retrieve your content from Kentico Kontent using the Delivery API.

Table of contents

    The Delivery API is a read-only REST API that can serve your content in two modes: public and preview. In public mode, you can only retrieve content that is published and publicly available. In preview mode, you can retrieve published as well as any unpublished content.

    This tutorial covers using the Delivery API in public mode, in which you don't need to authenticate your requests. Let's dive in and see what you need to retrieve a list of specific content items, such as articles.

    Getting content items

    To retrieve content items from a project, you will need the project ID. Your project is the primary organizational unit in Kentico Kontent. Every project is uniquely identified by an ID. You need to use the ID to tell the Delivery API where to look for content. For example, a project ID might look like this: 8d20758c-d74c-4f59-ae04-ee928c0816b.

    To get the ID of your project:

    1. In Kentico Kontent, choose a project.
    2. From the app menu, choose .
    3. Under Environment settings, choose API keys.
    4. In the Delivery API box, click .

    With the project ID, you can now make queries to the Delivery API using a URL such as https://deliver.kontent.ai/<YOUR_PROJECT_ID>/items.

    • Swift
    // Tip: Find more about Swift SDK at https://docs.kontent.ai/ios import KenticoKontentDelivery let client = DeliveryClient.init(projectId: "8d20758c-d74c-4f59-ae04-ee928c0816b7") // Note: Using 'items' as custom query returns all content items, // but to map them to a single model, a filter is needed. let customQuery = "items?system.type=article" // More about strongly-typed models https://github.com/Kentico/kontent-delivery-sdk-swift#using-strongly-typed-models client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Tip: Find more about Swift SDK at https://docs.kontent.ai/ios import KenticoKontentDelivery let client = DeliveryClient.init(projectId: "8d20758c-d74c-4f59-ae04-ee928c0816b7") // Note: Using 'items' as custom query returns all content items, // but to map them to a single model, a filter is needed. let customQuery = "items?system.type=article" // More about strongly-typed models https://github.com/Kentico/kontent-delivery-sdk-swift#using-strongly-typed-models client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Tip: Find more about Java SDK at https://docs.kontent.ai/java import com.github.kentico.kontent.delivery; DeliveryClient client = new DeliveryClient("8d20758c-d74c-4f59-ae04-ee928c0816b7"); List<NameValuePair> params = DeliveryParameterBuilder.params() .build(); CompletionStage<ContentItemsListingResponse> listingResponse = client.getItems();
    // Tip: Find more about Java SDK at https://docs.kontent.ai/java import com.github.kentico.kontent.delivery; DeliveryClient client = new DeliveryClient("8d20758c-d74c-4f59-ae04-ee928c0816b7"); List<NameValuePair> params = DeliveryParameterBuilder.params() .build(); CompletionStage<ContentItemsListingResponse> listingResponse = client.getItems();
    • JavaScript
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript const KontentDelivery = require('@kentico/kontent-delivery'); const deliveryClient = new KontentDelivery.DeliveryClient({ projectId: '8d20758c-d74c-4f59-ae04-ee928c0816b7' }); deliveryClient.items() .toObservable() .subscribe(response => console.log(response));
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript const KontentDelivery = require('@kentico/kontent-delivery'); const deliveryClient = new KontentDelivery.DeliveryClient({ projectId: '8d20758c-d74c-4f59-ae04-ee928c0816b7' }); deliveryClient.items() .toObservable() .subscribe(response => console.log(response));
    • C#
    // Tip: Find more about .NET SDKs at https://docs.kontent.ai/net using Kentico.Kontent.Delivery; // Creates an instance of the delivery client // ProTip: Use DI for this in your apps https://docs.kontent.ai/net-register-client IDeliveryClient client = DeliveryClientBuilder .WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7") .Build(); // Gets all content items // Note: Using the <object> generic parameter produces strongly typed objects, based on "system.type" IDeliveryItemListingResponse<object> response = await client.GetItemsAsync<object>(); IList<object> items = response.Items;
    // Tip: Find more about .NET SDKs at https://docs.kontent.ai/net using Kentico.Kontent.Delivery; // Creates an instance of the delivery client // ProTip: Use DI for this in your apps https://docs.kontent.ai/net-register-client IDeliveryClient client = DeliveryClientBuilder .WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7") .Build(); // Gets all content items // Note: Using the <object> generic parameter produces strongly typed objects, based on "system.type" IDeliveryItemListingResponse<object> response = await client.GetItemsAsync<object>(); IList<object> items = response.Items;
    • PHP
    // Tip: Find more about PHP SDKs at https://docs.kontent.ai/php // Defined by Composer to include required libraries require __DIR__ . '/vendor/autoload.php'; use Kentico\Kontent\Delivery\DeliveryClient; $client = new DeliveryClient('8d20758c-d74c-4f59-ae04-ee928c0816b7'); $items = $client->getItems();
    // Tip: Find more about PHP SDKs at https://docs.kontent.ai/php // Defined by Composer to include required libraries require __DIR__ . '/vendor/autoload.php'; use Kentico\Kontent\Delivery\DeliveryClient; $client = new DeliveryClient('8d20758c-d74c-4f59-ae04-ee928c0816b7'); $items = $client->getItems();
    • cURL
    curl --request GET \ --url 'https://deliver.kontent.ai/8d20758c-d74c-4f59-ae04-ee928c0816b7/items' --header 'content-type: application/json'
    curl --request GET \ --url 'https://deliver.kontent.ai/8d20758c-d74c-4f59-ae04-ee928c0816b7/items' --header 'content-type: application/json'
    • Ruby
    # Tip: Find more about Ruby SDKs at https://docs.kontent.ai/ruby require 'delivery-sdk-ruby' delivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '8d20758c-d74c-4f59-ae04-ee928c0816b7' delivery_client.items.execute do |response| items = response.items items.each { |item| puts item.system.codename } end
    # Tip: Find more about Ruby SDKs at https://docs.kontent.ai/ruby require 'delivery-sdk-ruby' delivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '8d20758c-d74c-4f59-ae04-ee928c0816b7' delivery_client.items.execute do |response| items = response.items items.each { |item| puts item.system.codename } end
    • TypeScript
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript import { ContentItem, DeliveryClient } from '@kentico/kontent-delivery'; const deliveryClient = new DeliveryClient({ projectId: '8d20758c-d74c-4f59-ae04-ee928c0816b7' }); deliveryClient.items<ContentItem>() .toObservable() .subscribe(response => console.log(response));
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript import { ContentItem, DeliveryClient } from '@kentico/kontent-delivery'; const deliveryClient = new DeliveryClient({ projectId: '8d20758c-d74c-4f59-ae04-ee928c0816b7' }); deliveryClient.items<ContentItem>() .toObservable() .subscribe(response => console.log(response));

    Calling the /items endpoint gives you all content items from the specified project in the form of a paged list response returned as JSON. Note that recently published items may appear in the Delivery API after a slight delay.

    Paging the results

    If you don't need all content items at once, you can tinker with the paging by specifying the limit and skip query parameters.

    For example, calling the /items endpoint with the limit=3&skip=6 query parameters sets the page size to 3 and gives you the third page.

    Filtering content items

    Now that you can get all content items from your project, you need to filter them to get only a specific few. In this example, you'll retrieve articles. These are the content items based on the Article content type.

    To move any further, you need to find the codename of the Article content type.

    Quick facts about codenames

    Codenames are identifiers of objects in Kentico Kontent. A codename is initially generated by the system from the object's name when it's saved for the first time, unless you specify one while adding the type.

    You can copy codenames by clicking  near the name of a content type, content element, or other objects in your project. For content items, click More actions > Codename.

    A screenshot of a codename in a type.

    Example: Displaying the codename of the Article content type.

    Once you have the codename (in this case article) you can use it to filter the requested content items by their type.

    The information about a content item's type is stored in the System object within its type property. The System object contains metadata about the content item such as last content modification date, content type the item is based on, language, etc.

    • JSON
    "system": { "id": "31f8470f-8a94-438a-8a47-f4cdb9c90ada", "name": "Why structured writing needs structured content", "codename": "structured_writing", "language": "en-US", "type": "article", "sitemap_locations": [], "last_modified": "2020-01-27T13:43:47.134249Z" }
    "system": { "id": "31f8470f-8a94-438a-8a47-f4cdb9c90ada", "name": "Why structured writing needs structured content", "codename": "structured_writing", "language": "en-US", "type": "article", "sitemap_locations": [], "last_modified": "2020-01-27T13:43:47.134249Z" }

    To filter the content items by type, you need to compare the value in the type system property to article using the following notation: system.type=article. Any content items that are not based on the Article content type will be omitted from the response.

    • Swift
    // Tip: Find more about Swift SDK at https://docs.kontent.ai/ios import KenticoKontentDelivery let client = DeliveryClient.init(projectId: "8d20758c-d74c-4f59-ae04-ee928c0816b7") let customQuery = "items?system.type=article" // More about strongly-typed models https://github.com/Kentico/kontent-delivery-sdk-swift#using-strongly-typed-models client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Tip: Find more about Swift SDK at https://docs.kontent.ai/ios import KenticoKontentDelivery let client = DeliveryClient.init(projectId: "8d20758c-d74c-4f59-ae04-ee928c0816b7") let customQuery = "items?system.type=article" // More about strongly-typed models https://github.com/Kentico/kontent-delivery-sdk-swift#using-strongly-typed-models client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Tip: Find more about Java SDK at https://docs.kontent.ai/java import kentico.kontent.delivery.*; DeliveryClient client = new DeliveryClient("8d20758c-d74c-4f59-ae04-ee928c0816b7"); List<NameValuePair> params = DeliveryParameterBuilder.params() .filterEquals("system.type", "article") .build(); // Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models CompletionStage<List<ArticleItem>> items = client.getItems(ArticleItem.class);
    // Tip: Find more about Java SDK at https://docs.kontent.ai/java import kentico.kontent.delivery.*; DeliveryClient client = new DeliveryClient("8d20758c-d74c-4f59-ae04-ee928c0816b7"); List<NameValuePair> params = DeliveryParameterBuilder.params() .filterEquals("system.type", "article") .build(); // Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models CompletionStage<List<ArticleItem>> items = client.getItems(ArticleItem.class);
    • JavaScript
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript const KontentDelivery = require('@kentico/kontent-delivery'); const deliveryClient = new KontentDelivery.DeliveryClient({ projectId: '8d20758c-d74c-4f59-ae04-ee928c0816b7', typeResolvers: [ // Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models new KontentDelivery.TypeResolver('article', (rawData) => new Article()) ] }); deliveryClient.items() .type('article') .toObservable() .subscribe(response => console.log(response));
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript const KontentDelivery = require('@kentico/kontent-delivery'); const deliveryClient = new KontentDelivery.DeliveryClient({ projectId: '8d20758c-d74c-4f59-ae04-ee928c0816b7', typeResolvers: [ // Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models new KontentDelivery.TypeResolver('article', (rawData) => new Article()) ] }); deliveryClient.items() .type('article') .toObservable() .subscribe(response => console.log(response));
    • C#
    // Tip: Find more about .NET SDKs at https://docs.kontent.ai/net using Kentico.Kontent.Delivery; // Creates an instance of the delivery client // ProTip: Use DI for this in your apps https://docs.kontent.ai/net-register-client IDeliveryClient client = DeliveryClientBuilder .WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7") .Build(); // Gets all articles // Create strongly typed models according to https://docs.kontent.ai/net-strong-types IDeliveryItemListingResponse<Article> response = await client.GetItemsAsync<Article>( new EqualsFilter("system.type", "article") ); IList<Article> items = response.Items;
    // Tip: Find more about .NET SDKs at https://docs.kontent.ai/net using Kentico.Kontent.Delivery; // Creates an instance of the delivery client // ProTip: Use DI for this in your apps https://docs.kontent.ai/net-register-client IDeliveryClient client = DeliveryClientBuilder .WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7") .Build(); // Gets all articles // Create strongly typed models according to https://docs.kontent.ai/net-strong-types IDeliveryItemListingResponse<Article> response = await client.GetItemsAsync<Article>( new EqualsFilter("system.type", "article") ); IList<Article> items = response.Items;
    • PHP
    // Tip: Find more about PHP SDKs at https://docs.kontent.ai/php // Defined by Composer to include required libraries require __DIR__ . '/vendor/autoload.php'; use Kentico\Kontent\Delivery\DeliveryClient; use Kentico\Kontent\Delivery\QueryParams; $client = new DeliveryClient('8d20758c-d74c-4f59-ae04-ee928c0816b7'); $items = $client->getItems((new QueryParams()) ->equals('system.type', 'article'));
    // Tip: Find more about PHP SDKs at https://docs.kontent.ai/php // Defined by Composer to include required libraries require __DIR__ . '/vendor/autoload.php'; use Kentico\Kontent\Delivery\DeliveryClient; use Kentico\Kontent\Delivery\QueryParams; $client = new DeliveryClient('8d20758c-d74c-4f59-ae04-ee928c0816b7'); $items = $client->getItems((new QueryParams()) ->equals('system.type', 'article'));
    • cURL
    curl --request GET \ --url 'https://deliver.kontent.ai/8d20758c-d74c-4f59-ae04-ee928c0816b7/items?system.type=article' --header 'content-type: application/json'
    curl --request GET \ --url 'https://deliver.kontent.ai/8d20758c-d74c-4f59-ae04-ee928c0816b7/items?system.type=article' --header 'content-type: application/json'
    • Ruby
    # Tip: Find more about Ruby SDKs at https://docs.kontent.ai/ruby require 'delivery-sdk-ruby' delivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '8d20758c-d74c-4f59-ae04-ee928c0816b7' delivery_client.items('system.type'.eq 'article').execute do |response| items = response.items items.each { |item| puts item.system.codename } end
    # Tip: Find more about Ruby SDKs at https://docs.kontent.ai/ruby require 'delivery-sdk-ruby' delivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '8d20758c-d74c-4f59-ae04-ee928c0816b7' delivery_client.items('system.type'.eq 'article').execute do |response| items = response.items items.each { |item| puts item.system.codename } end
    • TypeScript
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript import { DeliveryClient, TypeResolver } from '@kentico/kontent-delivery'; import { Article } from './models/Article'; const deliveryClient = new DeliveryClient({ projectId: '8d20758c-d74c-4f59-ae04-ee928c0816b7', typeResolvers: [ // Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models new TypeResolver('article', (rawData) => new Article) ] }); deliveryClient.items<Article>() .type('article') .toObservable() .subscribe(response => console.log(response));
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript import { DeliveryClient, TypeResolver } from '@kentico/kontent-delivery'; import { Article } from './models/Article'; const deliveryClient = new DeliveryClient({ projectId: '8d20758c-d74c-4f59-ae04-ee928c0816b7', typeResolvers: [ // Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models new TypeResolver('article', (rawData) => new Article) ] }); deliveryClient.items<Article>() .type('article') .toObservable() .subscribe(response => console.log(response));

    The value comparison is done using the equals operator (=). You can also filter your content using many other criteria like an element value, publish date, and more. Check out content filtering examples to see what's possible.

    Ordering content items

    The Delivery API sorts content items alphabetically by their codenames by default. But with content like articles, you usually want to retrieve and display them in a certain order and get, for example, only three latest articles from your project.

    When getting lists of content items, you can specify their order by using the order query parameter. The value of the order query parameter must be in the following format: <PropertyToOrderBy>[<asc|desc>]. Where the PropertyToOrderBy value specifies either a System property (such as system.type) or a content element within a content item (such as elements.title). For instance, if you don't specify the order when retrieving content, it is the equivalent of adding order=system.codename[asc] to your query.

    To get three latest articles from your project, you need to provide the following query parameters:

    • system.type=article – specifies the content type of the content items.
    • limit=3 – sets the number of content items to return (sometimes also referred to as page size).
    • order=system.last_modified[desc] – sorts the content items by last modification date in descending order.
    • Swift
    // Tip: Find more about Swift SDK at https://docs.kontent.ai/ios import KenticoKontentDelivery let client = DeliveryClient.init(projectId: "8d20758c-d74c-4f59-ae04-ee928c0816b7") let customQuery = "items?system.type=article&limit=3&order=system.last_modified[desc]" // More about strongly-typed models https://github.com/Kentico/kontent-delivery-sdk-swift#using-strongly-typed-models client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    // Tip: Find more about Swift SDK at https://docs.kontent.ai/ios import KenticoKontentDelivery let client = DeliveryClient.init(projectId: "8d20758c-d74c-4f59-ae04-ee928c0816b7") let customQuery = "items?system.type=article&limit=3&order=system.last_modified[desc]" // More about strongly-typed models https://github.com/Kentico/kontent-delivery-sdk-swift#using-strongly-typed-models client.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in if isSuccess { if let articles = itemsResponse?.items { // Use your items here } } else { if let error = error { print(error) } } }
    • Java
    // Tip: Find more about Java SDK at https://docs.kontent.ai/java import com.github.kentico.kontent.delivery; DeliveryClient client = new DeliveryClient("8d20758c-d74c-4f59-ae04-ee928c0816b7"); List<NameValuePair> params = DeliveryParameterBuilder.params() .filterEquals("system.type", "article") .page(null, 3) .orderByDesc("system.last_modified") .build(); // Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models CompletionStage<List<ArticleItem>> items = client.getItems(ArticleItem.class, params);
    // Tip: Find more about Java SDK at https://docs.kontent.ai/java import com.github.kentico.kontent.delivery; DeliveryClient client = new DeliveryClient("8d20758c-d74c-4f59-ae04-ee928c0816b7"); List<NameValuePair> params = DeliveryParameterBuilder.params() .filterEquals("system.type", "article") .page(null, 3) .orderByDesc("system.last_modified") .build(); // Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models CompletionStage<List<ArticleItem>> items = client.getItems(ArticleItem.class, params);
    • JavaScript
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript const KontentDelivery = require('@kentico/kontent-delivery'); const deliveryClient = new KontentDelivery.DeliveryClient({ projectId: '8d20758c-d74c-4f59-ae04-ee928c0816b7', typeResolvers: [ // Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models new KontentDelivery.TypeResolver('article', (rawData) => new Article()) ] }); deliveryClient.items() .type('article') .limitParameter(3) .orderParameter('system.last_modified', KontentDelivery.SortOrder.desc) .toObservable() .subscribe(response => console.log(response));
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript const KontentDelivery = require('@kentico/kontent-delivery'); const deliveryClient = new KontentDelivery.DeliveryClient({ projectId: '8d20758c-d74c-4f59-ae04-ee928c0816b7', typeResolvers: [ // Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models new KontentDelivery.TypeResolver('article', (rawData) => new Article()) ] }); deliveryClient.items() .type('article') .limitParameter(3) .orderParameter('system.last_modified', KontentDelivery.SortOrder.desc) .toObservable() .subscribe(response => console.log(response));
    • C#
    // Tip: Find more about .NET SDKs at https://docs.kontent.ai/net using Kentico.Kontent.Delivery; // Creates an instance of the delivery client // ProTip: Use DI for this in your apps https://docs.kontent.ai/net-register-client IDeliveryClient client = DeliveryClientBuilder .WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7") .Build(); // Gets the 3 latest articles ordered by their last modified time // Create strongly typed models according to https://docs.kontent.ai/net-strong-types IDeliveryItemListingResponse<Article> response = await client.GetItemsAsync<Article>( new EqualsFilter("system.type", "article"), new LimitParameter(3), new OrderParameter("system.last_modified", SortOrder.Descending) ); IList<Article> items = response.Items;
    // Tip: Find more about .NET SDKs at https://docs.kontent.ai/net using Kentico.Kontent.Delivery; // Creates an instance of the delivery client // ProTip: Use DI for this in your apps https://docs.kontent.ai/net-register-client IDeliveryClient client = DeliveryClientBuilder .WithProjectId("8d20758c-d74c-4f59-ae04-ee928c0816b7") .Build(); // Gets the 3 latest articles ordered by their last modified time // Create strongly typed models according to https://docs.kontent.ai/net-strong-types IDeliveryItemListingResponse<Article> response = await client.GetItemsAsync<Article>( new EqualsFilter("system.type", "article"), new LimitParameter(3), new OrderParameter("system.last_modified", SortOrder.Descending) ); IList<Article> items = response.Items;
    • PHP
    // Tip: Find more about PHP SDKs at https://docs.kontent.ai/php // Defined by Composer to include required libraries require __DIR__ . '/vendor/autoload.php'; use Kentico\Kontent\Delivery\DeliveryClient; use Kentico\Kontent\Delivery\QueryParams; $client = new DeliveryClient('8d20758c-d74c-4f59-ae04-ee928c0816b7'); $items = $client->getItems((new QueryParams()) ->equals('system.type', 'article') ->limit(3) ->orderDesc('system.last_modified'));
    // Tip: Find more about PHP SDKs at https://docs.kontent.ai/php // Defined by Composer to include required libraries require __DIR__ . '/vendor/autoload.php'; use Kentico\Kontent\Delivery\DeliveryClient; use Kentico\Kontent\Delivery\QueryParams; $client = new DeliveryClient('8d20758c-d74c-4f59-ae04-ee928c0816b7'); $items = $client->getItems((new QueryParams()) ->equals('system.type', 'article') ->limit(3) ->orderDesc('system.last_modified'));
    • cURL
    curl --request GET \ --url 'https://deliver.kontent.ai/8d20758c-d74c-4f59-ae04-ee928c0816b7/items?system.type=article&limit=3&order=system.last_modified[desc]' --header 'content-type: application/json'
    curl --request GET \ --url 'https://deliver.kontent.ai/8d20758c-d74c-4f59-ae04-ee928c0816b7/items?system.type=article&limit=3&order=system.last_modified[desc]' --header 'content-type: application/json'
    • Ruby
    # Tip: Find more about Ruby SDKs at https://docs.kontent.ai/ruby require 'delivery-sdk-ruby' delivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '8d20758c-d74c-4f59-ae04-ee928c0816b7' delivery_client.items('system.type'.eq 'article') .limit(3) .order_by('system.last_modified', '[desc]') .execute do |response| items = response.items items.each { |item| puts item.system.codename } end
    # Tip: Find more about Ruby SDKs at https://docs.kontent.ai/ruby require 'delivery-sdk-ruby' delivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '8d20758c-d74c-4f59-ae04-ee928c0816b7' delivery_client.items('system.type'.eq 'article') .limit(3) .order_by('system.last_modified', '[desc]') .execute do |response| items = response.items items.each { |item| puts item.system.codename } end
    • TypeScript
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript import { DeliveryClient, SortOrder, TypeResolver } from '@kentico/kontent-delivery'; import { Article } from './models/Article'; const deliveryClient = new DeliveryClient({ projectId: '8d20758c-d74c-4f59-ae04-ee928c0816b7', typeResolvers: [ // Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models new TypeResolver('article', (rawData) => new Article) ] }); deliveryClient.items<Article>() .type('article') .limitParameter(3) .orderParameter('system.last_modified', SortOrder.desc) .toObservable() .subscribe(response => console.log(response));
    // Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript import { DeliveryClient, SortOrder, TypeResolver } from '@kentico/kontent-delivery'; import { Article } from './models/Article'; const deliveryClient = new DeliveryClient({ projectId: '8d20758c-d74c-4f59-ae04-ee928c0816b7', typeResolvers: [ // Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models new TypeResolver('article', (rawData) => new Article) ] }); deliveryClient.items<Article>() .type('article') .limitParameter(3) .orderParameter('system.last_modified', SortOrder.desc) .toObservable() .subscribe(response => console.log(response));

    What's next?

    You've learned how to get specific content from your Kentico Kontent project with filtering and sorting. Besides fetching content items, you can also use the Delivery API to get content types, elements, and taxonomies. 

    Want to create an SDK for your preferred technology? Check out our guidelines for SDK developersOpens in a new window.