Skip to main content

nu-private-api

Read-only Python client for discovering and parsing public NU.nl articles.

PyPI Python License Downloads

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.
  • Use built-in SectionUrl values or pass raw NU.nl URLs.
  • Bring your own configured httpx.Client when 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, SectionUrl

client = NuClient()

urls = client.section_by_url(SectionUrl.BINNENLAND)
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.section_by_url(url)

Fetches a NU.nl section/list page and returns de-duplicated absolute article URLs.

from nu_private_api import NuClient, SectionUrl

client = NuClient()
urls = client.section_by_url(SectionUrl.ECONOMIE)

url can be a SectionUrl enum value or a string URL.

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

nu_private_api-0.2.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nu_private_api-0.2.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file nu_private_api-0.2.0.tar.gz.

File metadata

  • Download URL: nu_private_api-0.2.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.7

File hashes

Hashes for nu_private_api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 46470ad6ba6b4bab8abe382cdee0f6d8920e554856284272874544edfe45813c
MD5 c499a64e84b1c6e0cd067ef63febe4fa
BLAKE2b-256 e8200d927f1b9b78e41e2b0d1c19fbebd7a3f87b59c3d993a941e647458ab16d

See more details on using hashes here.

File details

Details for the file nu_private_api-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: nu_private_api-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.7

File hashes

Hashes for nu_private_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc71e1d1b97708dccad1b529dd828ab8e8462f53dc4df4e6714a6ab44828bb82
MD5 9272ecfca91b4e3ab91e0199a65cc5e5
BLAKE2b-256 cfae9c8a055e9f3b3c3fd43ce84c30c4095cfc0e67ba3d87609734cb94b409e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page