Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Python wrapper for the PostNL API, a way to track packages and letters.

Project description


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

Quick test

When installed:

python -m postnl_api.test_postnl_api USERNAME PASSWORD

Or running directly: USERNAME PASSWORD

Code Example

from postnl_api import PostNL_API

# Login using your credentials
postnl = PostNL_API('', 'password')

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

# Get relevant deliveries
print("Getting all deliveries")
all_deliveries = postnl.get_deliveries()
for delivery in all_deliveries:

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

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


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


See the CHANGELOG file.




Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for postnl-api, version 1.2.2
Filename, size File type Python version Upload date Hashes
Filename, size postnl_api-1.2.2-py3-none-any.whl (7.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size postnl_api-1.2.2.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page