How to get the SEO title (`seo_title`), keywords (`keywords`), and description (`description`) of a document?

Calendar 👁️ 70

In website operation, set clear and targeted SEO titles for content (seo_title), keywords (keywords) and descriptions (descriptionIt is a key step to improve search engine ranking.AnQiCMS (AnQiCMS) provides a convenient way to manage and obtain these important SEO metadata.Whether you need to dynamically set this information for a single page or process a large amount of content in bulk, it can be easily achieved through the provided API interface.

Get SEO information for a single document

When you need to obtain the SEO title, keywords, and description of a specific document, you can use the document detail interface of Anqi CMS.This interface can return a complete document data, which includes these SEO-related fields.

In particular, you can send a GET request to the following address to retrieve document details:

{域名地址}/api/archive/detail

When making a request, you need to provide the unique identifier of the document. Typically, this can be the document ID (id) or the URL alias (filenameFor example, if you know the document ID is 1, then your request parameters may beid=1.

The data returned by the interface will bedataThe object contains the following fields, which are exactly the SEO information you are looking for:

  • seo_title(string type): This field stores the SEO title specifically set for this document.It is usually more concise than the title of the document itself, or contains more keywords, intended to attract search engine users to click.
  • keywords(string type): This field contains keywords highly related to the document content, usually separated by commas.These keywords help search engines understand the document theme and display it when users search.
  • description(string type): This field is a brief overview of the document content, used to display in search engine results pages (SERP).A good description can effectively attract users and improve click-through rate.

By parsing the return data of this interface, you can easily apply these key SEO information to your frontend page, thereby optimizing the single-page search engine performance.

Bulk retrieval of document SEO information

In some cases, such as generating lists for category pages or tag pages, or building in-site search results, you may need to batch retrieve SEO information for multiple documents.At this time, the document list interface of Anqi CMS can come into play.

You can retrieve the document list by sending a GET request to the following address:

{域名地址}/api/archive/list

This interface supports various filtering and sorting parameters, such as you can limit the range of returned documents based on model ID (moduleId), classification ID (categoryId) as well, and you can also limit throughlimitandpageThe parameters are for pagination. For example, you can specifymoduleId=1andtype=pageto get the list of all documents under the article model (pagination mode).

in the interface returneddataIn the array, each element represents a document and also containsseo_title/keywordsanddescriptionThese three important fields. This means you do not need to call the detail interface one by one, but can obtain the SEO metadata of multiple documents at one time, greatly improving the efficiency of data acquisition.

For example, you can use this feature to dynamically generate category pages.meta title/meta keywordsandmeta descriptionOr display a concise description below each article item on the website, increasing the information density of user browsing.

Optimize practice

After obtaining this SEO information, the next task is how to effectively use it.The website's SEO performance not only depends on high-quality content, but also cannot do without precise metadata settings.<head>Tags within are the basis for good search engine optimization.In addition, regularly check the filling of this metadata to ensure its relevance to the content, and adjust according to the changes in search engine algorithms, which will help your website stand out in a competitive online environment.

Frequently Asked Questions (FAQ)

  1. If the document'sseo_title/keywordsordescriptionWhat if the return is empty?If these fields return empty, it usually means that the SEO-related metadata has not been manually filled in when editing documents in the Anqi CMS backend. In this case, you can consider several ways: one is to return an empty value, allowing search engines to decide on the content to display; two is to use the document'stitleasseo_titleExtract an abstract from the content asdescriptionAnd generate based on document tags or categorieskeywordsAs a supplement. Of course, the most recommended approach is to perfect this information in the background management to achieve more accurate SEO effects.
  2. ObtainedkeywordsHow to parse a string into multiple keywords for use?As described in the API documentation,keywordsA field is a string type. In practice, Anqi CMS usually separates multiple keywords with a comma (,) separated in this string. Therefore, you can use the string splitting feature of programming languages (such as JavaScript'ssplit(','),Python insplit(','))Parse it into a keyword array and then display or further process it accordingly.
  3. How to obtain SEO information for other content types (such as categories, single pages) except for documents?AnQi CMS took into account the SEO needs of different content types during design. In addition to the document detail interface, the category detail interface (/api/category/detail) and the single page detail interface (/api/page/detail) It also provides similar SEO fields. You just need to call the corresponding interface, pass in the category ID or single page ID (or URL alias), and you can find it in the returneddataobject.seo_title/keywordsanddescriptionThe retrieval and usage method is similar to the document details interface.

Related articles

What are the common meanings of the `code` and `msg` fields in the document details interface?

When using AnQiCMS for website development or integration, we often deal with API interfaces.When handling the return results of these interfaces, the `code` and `msg` fields are almost indispensable parts of all response data.They play the role of 'traffic lights' and 'instruction manuals', helping us quickly understand the processing results of the request, whether successful or not.### `code` field: Quickly judge the status code of the request result The `code` field is an integer value

2025-11-09

How to extract the complete content of the document from the returned data of the document detail interface?

In website operation, we often need to dynamically obtain and display the articles or product details of the site.AnQiCMS (AnQiCMS) provides a powerful and flexible API interface, making this process very convenient.Among them, the interface for obtaining document details is one of the core ones, which not only returns the basic information of the document but also allows you to easily obtain the complete content of the article.This article will guide you on how to accurately extract the complete content of the document from the document detail interface return data of Anqi CMS.

2025-11-09

What HTTP request methods does the AnQi CMS document detail interface support?

When building websites or developing various applications, we often need to obtain detailed information about articles or documents from a content management system (CMS).AnQiCMS (AnQiCMS) is a powerful content management platform and naturally provides such an interface, allowing developers to flexibly obtain various document content on the website.So, when we want to get the specific article through the document detail interface of Anqi CMS, which HTTP request method should we use?

2025-11-09

What error message will the interface return if the document does not exist when getting the document details?

In the daily operation and development of Anqi CMS, we often need to retrieve website content through API interfaces, among which the 'Get Document Detail Interface' (`/api/archive/detail`) is undoubtedly one of the most frequently used ones.This interface allows us to retrieve the details of a specific article or product by document ID or URL alias (filename).However, during use, we are bound to encounter such situations: When the requested document does not exist in the system, what kind of error message will the interface return?This is for front-end page display

2025-11-09

What role does the `url_token` field play in the document details, and how is it associated with the `filename` parameter?

In the daily use of Anqi CMS, we often encounter the `url_token` field, especially when dealing with document details and URL structures.It is closely related to the `filename` parameter in the API interface. Understanding the relationship between the two is crucial for better management of website content, optimizing user experience, and improving search engine performance.### `url_token`:The "friendly" identity tag of content `url_token` is simply the term used in the AnQi CMS system for various types of content (such as documents

2025-11-09

What do the `module_id` and `category_id` fields represent in the document details, and can you further query model or category details through them?

## Unveiling the details of Anqi CMS document `module_id` and `category_id`: What do they mean?When using AnQi CMS for content management and website operation, we often obtain various data through API interfaces, among which the document detail interface (`/api/archive/detail`) is the key to obtaining the core information of a single article.In the returned data of this interface, you may notice the `module_id` and `category_id` fields.

2025-11-09

How to get the current view count (`views`) and comment count (`comment_count`) of the document?

When operating a website, understanding which content is more popular and which topics can spark discussion is crucial for optimizing content strategy.AnQiCMS (AnQiCMS) provides us with a convenient way to obtain this key data, such as the number of page views and comments on articles.Let's take a detailed look at how to obtain this information through the Anqi CMS API interface.

2025-11-09

How is the `images` field (document group image) stored and parsed in the document details?

When using AnQiCMS to manage website content, images are undoubtedly an important element in enhancing the attractiveness of the content, especially when we want to add a series of related images to the document, the album feature becomes particularly crucial.So, how are these group images stored and parsed in the AnQiCMS document details?Understanding this will help us better utilize AnQiCMS for content creation and display.### The storage mechanism of document group charts First

2025-11-09