You can use the Public Content API available through GraphQL and query pages based on metadata in the Content Data Store. The documentation for the Public Content API is available here.
Just tag the page with keywords through a page metadata schema and use a GraphQL query to fetch pages that have specific keywords. For instance, say you want to fetch page IDs tagged with keywords 010 News and 020 Further Information, a query like so would get those IDs:
{
items(
filter: {
itemTypes: [PAGE],
and: [
{ keyword: { categoryName: "Sitemap [Navigation]", key: "010 News"}},
{ keyword: { categoryName: "Sitemap [Navigation]", key: "020 Further Information"}},
]
}
)
{
edges {
node {
itemId
publicationId
title
... on Page {
url
}
}
}
}
}
Once you have the page IDs, you can get the CPs from those IDs through a query like so:
{
page(namespaceId: 1, publicationId: 5, pageId: 341) {
itemId
title
url
containerItems {
... on ComponentPresentation {
itemId
component {
itemId
title
multiMedia
}
}
}
}
}
And the output would be something like this:
{
"data": {
"page": {
"itemId": 341,
"title": "Example News 1",
"url": "/articles/news/news1.html",
"containerItems": [
{
"itemId": -1,
"component": {
"itemId": 282,
"title": "Example News 1",
"multiMedia": false
}
}
]
}
}
}