Contents

Search Articles in a Section

See a list of all articles in a section that match the specified search criteria.

URL

GET https://news-api.apple.com/sections/{sectionId}/articles

Path Parameters

NameTypeDescription
sectionId Requiredstring

The UUID of the section to search.

Query Parameters

NameTypeDescription
fromDate Optionalstring

If specified, the server only returns articles with a createdAt date later than fromDate.

pageSize Optionalinteger

The number of articles to return on each page. This value must be an integer between 1 and 100 (inclusive).

pageToken Optionalstring

An opaque token that specifies the page to view. The server returns links with the URL in each response. It also includes the pageToken for the next page.

sortDir Optionalstring

Indicates whether to return oldest articles first (ASC) or newest articles first (DESC).

toDate Optionalstring

If specified, the server only returns articles with a createdAt date earlier than toDate.

Response Codes

StatusReasonTypeDescription
200OK
Content-Type: application/json
SearchResponse

The request was successful.

400Bad Request
Content-Type: application/json
Error

  • MISSING. You didn’t include the Channel UUID field in the request. Key path: *

  • INVALID_TYPE. The value you specified for channelId is not of the correct type for that field. Key path: channelId.

  • INVALID. The pageToken parameter isn’t a valid token returned in a next link or nextPageToken field. Key path: pageToken

  • INVALID. The sortDir parameter isn’t ASC or DESC. Key path: sortDir

  • INVALID. The fromDate parameter isn’t in ISO 8601 date format. Key path: fromDate

  • INVALID. The toDate parameter isn’t in ISO 8601 date format. Key path: toDate.

  • INVALID. The pageSize parameter isn’t an integer in the range 1 to 100 (inclusive). Key path: pageSize.

401Unauthorized
Content-Type: application/json
Error

You didn’t include the Authorization header. Key path: N/A

403Forbidden
Content-Type: application/json
Error

You tried to access a section your API key doesn’t have permission to access. Key path: N/A

404Not Found
Content-Type: application/json
Error

  • The endpoint you tried to access doesn’t exist. Key path: N/A.

  • The section you tried to access doesn’t exist. Key path: sectionId.

429Too Many Requests
Content-Type: application/json
Error

You exceeded the number of articles that you can search for in a section within the specific time window. The response header <Retry-After: delay-seconds> indicates the time in seconds you need to wait before sending a new search request.

Discussion

A Search Articles request returns a list of all articles in a section that were created between fromDate and toDate. The results of this call are paginated, with a maximum page size of 100. Each response contains a link to the next page of results.

Example

See Also

Articles