[ad_1]
I wondered if someone could anyone point me in the right direction to create the following:
Create a widget that someone can paste into their own website (site B) to show some statistics from site A.
For example: Show the number of posts from the user with the ID “563”.
The function should be secure and visible on their own website via a simple Script/HTML function (no iframe).
[ad_2]
The links below should help you get started.
https://developer.wordpress.com/docs/api/1.1/get/sites/%24site/post-counts/%24post_type/
https://stackoverflow.com/questions/53745643/wordpress-get-user-count-from-other-site
https://stackoverflow.com/questions/68610947/wp-rest-api-return-posts-created-by-user
You could potentially also use https://developer.wordpress.org/reference/functions/count_user_posts/ to create your own end point that can be fetched via a script on site B.
r/prowordpress might be better suited for this as well.