I wanted to get the Post ID of a post from another website, but it was not in the url, but it was in the Response Header.
When I output the Response Header, the Post ID does not appear on the output. Do you have a solution for getting the Post ID ?
WordPress's REST API should provide the information you need.
If you're after a post with the slug the-slug-you-want
, then you can request the data about any post(s) with that slug using the URL https://example.com/wp-json/v2/posts/?slug=the-slug-you-want
. This returns the post(s) with that slug, and in the post's/posts' JSON objects the ID is available.
https://example.com/wp-json/v2/posts/?slug=the-slug-you-want
would return the post(s) with that slug, and in the post's/posts' JSON objects the ID is available.