Search Articles
GET {{baseUrl}}/api/v2/help_center/articles/search?query=<string>&category=<integer>§ion=<integer>&label_names=<string>&locale=<string>&multibrand=<boolean>&brand_id=<integer>&created_before=<dateTime>&created_after=<dateTime>&created_at=<dateTime>&updated_before=<dateTime>&updated_after=<dateTime>&updated_at=<dateTime>&sort_by=<string>&sort_order=<string>
Returns a default number of 25 articles per page, up to a maximum of 1000 results. See Pagination. The per_page
parameter, if provided, must be an integer between 1 and 100.
The page
parameter, if provided, must be an integer greater than 0.
The results are sorted by relevance by default. You can also sort the results by created_at
or updated_at
.
The article objects returned by the search endpoint contain two additional properties:
Name | Type | Read-only | Mandatory | Comment |
---|---|---|---|---|
result_type | string | yes | no | For articles, always the string article |
snippet | string | yes | no | The portion of an article that is relevant to the search query, with matching words or phrases delimited by <em></em> tags. Example: a query for carrot potatomight return the snippet ...don't confuse ``carrots`` with ``potatoes``... |
You must specify at least one of the following parameters in your request:
- query
- category
- section
- label_names
Pagination
- Offset pagination only
See Pagination.
Returns a maximum of 100 articles per page.
Allowed for
- Anonymous users
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
query | string | The search text to be matched or a search string. Examples: "carrot potato", "'carrot potato'". | |
category | string | Limit the search to this category id. See Filtering by Category | |
section | string | Limit the search to this section id. See Filtering by Section | |
label_names | string | A comma-separated list of label names. See Filtering by Labels | |
locale | string | Search for articles in the specified locale. See Filtering by Locale | |
multibrand | string | Enable search across all brands if true. Defaults to false if omitted. | |
brand_id | string | Search for articles in the specified brand. | |
created_before | string | Limit the search to articles created before a given date (format YYYY-MM-DD). | |
created_after | string | Limit the search to articles created after a given date (format YYYY-MM-DD). | |
created_at | string | Limit the search to articles created on a given date (format YYYY-MM-DD). | |
updated_before | string | Limit the search to articles updated before a given date (format YYYY-MM-DD). | |
updated_after | string | Limit the search to articles updated after a given date (format YYYY-MM-DD). | |
updated_at | string | Limit the search to articles updated on a given date (format YYYY-MM-DD). | |
sort_by | string | One of created_at or updated_at. Defaults to sorting by relevance | |
sort_order | string | One of asc or desc. Defaults to desc |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string |
RESPONSES
status: OK
{"result_type":"article","results":[{"title":"\u003cstring\u003e","locale":"\u003cstring\u003e","user_segment_id":"\u003cinteger\u003e","permission_group_id":"\u003cinteger\u003e","author_id":"\u003cinteger\u003e","body":"\u003cstring\u003e","comments_disabled":"\u003cboolean\u003e","content_tag_ids":["\u003cstring\u003e","\u003cstring\u003e"],"created_at":"\u003cstring\u003e","draft":"\u003cboolean\u003e","edited_at":"\u003cstring\u003e","html_url":"\u003cstring\u003e","id":"\u003cinteger\u003e","label_names":["\u003cstring\u003e","\u003cstring\u003e"],"outdated":"\u003cboolean\u003e","outdated_locales":["\u003cstring\u003e","\u003cstring\u003e"],"position":"\u003cinteger\u003e","promoted":"\u003cboolean\u003e","section_id":"\u003cinteger\u003e","source_locale":"\u003cstring\u003e","updated_at":"\u003cstring\u003e","url":"\u003cstring\u003e","vote_count":"\u003cinteger\u003e","vote_sum":"\u003cinteger\u003e"},{"title":"\u003cstring\u003e","locale":"\u003cstring\u003e","user_segment_id":"\u003cinteger\u003e","permission_group_id":"\u003cinteger\u003e","author_id":"\u003cinteger\u003e","body":"\u003cstring\u003e","comments_disabled":"\u003cboolean\u003e","content_tag_ids":["\u003cstring\u003e","\u003cstring\u003e"],"created_at":"\u003cstring\u003e","draft":"\u003cboolean\u003e","edited_at":"\u003cstring\u003e","html_url":"\u003cstring\u003e","id":"\u003cinteger\u003e","label_names":["\u003cstring\u003e","\u003cstring\u003e"],"outdated":"\u003cboolean\u003e","outdated_locales":["\u003cstring\u003e","\u003cstring\u003e"],"position":"\u003cinteger\u003e","promoted":"\u003cboolean\u003e","section_id":"\u003cinteger\u003e","source_locale":"\u003cstring\u003e","updated_at":"\u003cstring\u003e","url":"\u003cstring\u003e","vote_count":"\u003cinteger\u003e","vote_sum":"\u003cinteger\u003e"}],"snippet":"\u003cstring\u003e"}