nu-private-api
Read-only Python client for discovering and parsing public NU.nl articles.
Overview | Install | Quick Start | API | Development
Overview
nu-private-api wraps the public NU.nl web GraphQL endpoint used by the site
itself. It is intentionally small: give it a section or article URL, get back
article URLs or a parsed article object.
Use it for scripts, experiments, and lightweight content extraction where a full browser is unnecessary.
[!WARNING] This is an unofficial client for NU.nl web endpoints. It may break when NU.nl changes its private response shape.
Features
- Fetch de-duplicated article URLs from public NU.nl section/list pages.
- Fetch and parse public article pages.
- Return normalized article fields: URL, title, description, publish time, modified time, author, and body text.
- Fetch section URLs from NU.nl's section sitemap.
- Bring your own configured
httpx.Clientwhen you need custom timeouts, proxies, headers, or lifecycle control.
Install
python -m pip install nu-private-api
Quick Start
from nu_private_api import NuClient
client = NuClient()
section_urls = client.sitemap_urls()
urls = client.section_by_url(section_urls[0])
article = client.article_by_url(urls[0])
print(article.title)
print(article.author)
print(article.body)
Raw URLs work too:
urls = client.section_by_url("https://www.nu.nl/binnenland")
article = client.article_by_url("https://www.nu.nl/123456/example.html")
Use your own httpx.Client if you want to control connection settings:
import httpx
from nu_private_api import NuClient
with httpx.Client(timeout=10) as http:
client = NuClient(client=http)
article = client.article_by_url("https://www.nu.nl/123456/example.html")
API
NuClient.sitemap_urls(url="https://www.nu.nl/sitemap_sections.xml")
Fetches a sitemap and returns the URLs from its <loc> entries.
from nu_private_api import NuClient
client = NuClient()
section_urls = client.sitemap_urls()
NuClient.section_by_url(url)
Fetches a NU.nl section/list page and returns de-duplicated absolute article URLs.
from nu_private_api import NuClient
client = NuClient()
section_urls = client.sitemap_urls()
urls = client.section_by_url(section_urls[0])
url is a NU.nl section/list URL string.
NuClient.article_by_url(url)
Fetches and parses a public article URL.
article = client.article_by_url(urls[0])
Returns an immutable Article dataclass:
Article(
url="...",
title="...",
description="...",
published_at="...",
modified_at="...",
author="...",
body="...",
)
Notes
- Public article reads do not require cookies or login.
- Video pages and live blogs are not supported.
- The current parser follows the observed NU.nl article shape:
base64 JSON-LD schema,
screenMetadata, and article text blocks. - API research notes live in
docs/apis.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nu_private_api-0.3.0.tar.gz.
File metadata
- Download URL: nu_private_api-0.3.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2035d093913b7627f68fd503e8153eb8a05384c944ad083354e7e61ff4244792
|
|
| MD5 |
848cbe314b38c0cd71f616f7bbcafadb
|
|
| BLAKE2b-256 |
063d204604a67141927307d5487285048408c2bdf4f2471666fabdbd273de7a8
|
File details
Details for the file nu_private_api-0.3.0-py3-none-any.whl.
File metadata
- Download URL: nu_private_api-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e15c36a6144ce3e3b9164c5c47cf01481ddfecdb964fc9eaa6559df8e6e3a9a2
|
|
| MD5 |
cdec813b48783a02cd43e2fb18e55d9c
|
|
| BLAKE2b-256 |
b556a4334b02175d0beb7cbf380615446e487b2eada0d034086cb9b5b24341c4
|