Eg they say a post object has a canonicalUrl, attribute. I can't tell from reading the docs, whether you can GET them via the API. All the examples are creating Medium posts via POST requests, and none are showing existing posts via GET requests.
But you presumably found some way to get it, so if you're getting it through an API endpoint, then check it for the canonicalUrl attribute. And if you're getting it by scraping it, then check for the link tag, eg this prints the expected value:
Looks like you might be able to get it via the API: github.com/Medium/medium-api-docs#...
Eg they say a post object has a
canonicalUrl, attribute. I can't tell from reading the docs, whether you canGETthem via the API. All the examples are creating Medium posts viaPOSTrequests, and none are showing existing posts viaGETrequests.But you presumably found some way to get it, so if you're getting it through an API endpoint, then check it for the
canonicalUrlattribute. And if you're getting it by scraping it, then check for thelinktag, eg this prints the expected value:(in reality, I'd use the CSS selector
link[rel="canonical"], but I wanted an example that didn't require installing fancy tooling)