I'm looking into the Decoupled Router to see how it works. It's job is to take a page url and return info about the entity. You can combine it with the Subrequests module to customize what to return for the url. There's not much documentation at the moment, so I dug into the code to see what's happening.
decoupled_router.routing.yml
Set up /router/translate-path endpoint, resolve to PathTranslator controller.
PathTranslator.php
Creates PathTranslatorEvent to fetch path info, sets json header and cache contexts and returns response.
PathTranslatorEvent.php
A KernelEvent, for processing path translations.
decoupled_router.services.yml
Defines logger, and router/redirect path translator services.
RouterPathTranslatorSubscriber.php
Event subscriber for PathTranslatorEvent that fetches router info.
RedirectPathTranslatorSubscriber.php
Extends RouterPathTranslatorSubscriber. Fetches redirect info.