Parse, classify, and normalize Pinterest URLs without making network requests.
SavePinner · Clojars · cljdoc
The library recognizes Pin, pin.it, profile, board, and Ideas URLs across
Pinterest country domains. It uses an exact host allow list, rejects HTTP URLs
and lookalike domains, and removes tracking parameters from normalized output.
With deps.edn:
net.clojars.jiankn/pinterest-url-normalizer {:mvn/version "0.1.0"}
With Leiningen:
[net.clojars.jiankn/pinterest-url-normalizer "0.1.0"]
(require '[savepinner.pinterest-url-normalizer :as pinterest])
(def parsed
(pinterest/parse-pinterest-url
"https://de.pinterest.com/pin/987654321/?utm_source=share"))
(:kind parsed) ; => :pin
(:pin-id parsed) ; => "987654321"
(:normalized-url parsed) ; => "https://www.pinterest.com/pin/987654321/"
(pinterest/pinterest-url? "https://pin.it/AbC123")
(pinterest/normalize-pinterest-url
"https://pinterest.co.uk/savepinner/media-tools/")
parse-pinterest-url throws ExceptionInfo with :code :invalid-url or
:code :unsupported-url when a value cannot be parsed.
| Kind | Example |
|---|---|
:pin | https://www.pinterest.com/pin/123456789/ |
:short | https://pin.it/AbC123 |
:profile | https://www.pinterest.com/savepinner/ |
:board | https://www.pinterest.com/savepinner/media-tools/ |
:ideas | https://www.pinterest.com/ideas/space-wallpaper/926295399832/ |
pin.it links are classified and normalized but are not followed. Resolving
them requires a network request and belongs in the consuming application.
lein test
lein jar
This parser is maintained by the team behind SavePinner, a browser tool for inspecting media exposed by public Pinterest Pin URLs. The library contains no downloader, tracking, browser automation, or remote code.
Pinterest is a trademark of Pinterest, Inc. This project is independent and is not affiliated with or endorsed by Pinterest.
MIT
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |