Sony has an API for retrieving details of the trophies an account has earned, but there is no public documentation for using it. This is an attempt at documenting the API by capturing the requests made by the https://my.playstation.com web site when browsing the trophy data of a PSN account.
This documentation can be viewed in a more friendly format at https://andshrew.github.io/PlayStation-Trophies/#/ courtesy of GitHub Pages and docsify.