Pinterest::URL::Normalizer
Parse, classify, and normalize Pinterest URLs without making network requests.
SavePinner · Raku package
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,
lookalike domains, credentials, and non-standard ports, and removes query
parameters and fragments from normalized output.
Install
zef install Pinterest::URL::Normalizer
Usage
use Pinterest::URL::Normalizer;
my $parsed = parse-pinterest-url(
'https://de.pinterest.com/pin/987654321/?utm_source=share'
);
say $parsed.kind; # pin
say $parsed.pin_id; # 987654321
say $parsed.normalized_url; # https://www.pinterest.com/pin/987654321/
say is-pinterest-url('https://pin.it/AbC123');
say normalize-pinterest-url(
'https://pinterest.co.uk/savepinner/media-tools/'
);
Supported URL kinds
| 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.
Development
raku -Ilib t/01-normalizer.rakutest
zef install .
Why this package exists
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.
License
MIT