Skip to main content

python-postnl-api

(Unofficial) Python wrapper for the PostNL API (Dutch Postal Services), which can be used to track packages and letter deliveries. You can use your jouw.postnl.nl credentials to use the API.

Quick test

When installed:

python -m postnl_api.test_postnl_api USERNAME PASSWORD

Or running directly:

test_postnl_api.py USERNAME PASSWORD

Code Example

from postnl_api import PostNL_API

# Login using your jouw.postnl.nl credentials
postnl = PostNL_API('email@domain.com', 'password')

# Retrieve relevant incoming packages
print("Getting relevant deliveries")
rel_deliveries = postnl.get_relevant_deliveries()
for delivery in rel_deliveries:
    print(delivery)

# Retrieve all incoming packages
print("Getting all deliveries")
all_deliveries = postnl.get_deliveries()
for delivery in all_deliveries:
    print(delivery)

# Retrieve sent packages
print("Getting all distributions (sent packages)")
distributions = postnl.get_distributions()
for distribution in distributions:
    print(distribution)

# Retrieve incoming letters
print("Getting all letters, if that function is turned on")
letters = postnl.get_letters()
for letter in letters:
    print(letter)

Miscellaneous

This blogpost describes the process of figuring out the API endpoints and shows how this can be done for other API's.

Changelog

See the CHANGELOG file.

Contributors

License

MIT

Metadata

Release files for postnl-api 1.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for postnl-api 1.2.3
File Size Uploaded
postnl_api-1.2.3.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for postnl-api 1.2.3
File Interpreter ABI Platform
postnl_api-1.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / postnl_api-1.2.3.tar.gz

Download URL postnl_api-1.2.3.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
eac33d40e0f35783139da2697a489b73ab37e1463b8b09c859a80952cc4af8ec
BLAKE2b-256 checksum
How to use checksums
7c0bcad85d5112107feb0e558510dae0bdbe90075c3b0ec0d926b2f4d55a5abe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.4

Release files / postnl_api-1.2.3-py3-none-any.whl

Download URL postnl_api-1.2.3-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4e218ff03d7931cb2fe57ace97b6e008de85373a5bacd1b6e531cfd52d7a7c8
BLAKE2b-256 checksum
How to use checksums
e3113f8c35b529f2fb788a3e4649c2824af23ceab8b2df3fe4fa762c8aa9bfae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.4

Release history Release notifications | RSS feed

This release

1.2.3 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

2 release files

0.3

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page