Skip to main content

rtbnext

Static Badge PyPI License PyPI Version

Official Python SDK for the RTBNext API.

The RTBNext SDK provides a typed, asynchronous interface for accessing billionaire profiles, lists, filters, statistics, historical data and system information from the RTBNext API.

The SDK follows a consistent resource-oriented design: resources are loaded lazily, cached according to the configured cache mode, and expose typed helper methods for collections, time series and indexed data.

The package includes Python type information and is compatible with static type checkers such as Pyright, Pylance and mypy.

To find a list of all available API endpoints, please refer to the API Documentation. Also visit the API endpoint or review the SDK Documentation for additional details. For updates on current issues or maintenance, please refer to the System Status.

Installation

Install the package using pip:

pip install rtbnext

First usage

Every client application must identify itself when creating an SDK instance. This information is sent with API requests and helps to provide transparency about API consumers.

import asyncio

from rtbnext import ClientIdentity, rtbnext


async def main() -> None:
    async with rtbnext(
        client= ClientIdentity(
            name= "my-application",
            version= "1.0.0",
            contact= "https://example.com/contact"
        )
    ) as client:

        stats = await client.stats.global_.data()
        print( stats["count"] )


asyncio.run( main() )

The client identity consists of:

  • name — application or project name
  • version — application version
  • contact — optional contact URL
  • email — optional contact email address

Core concepts

Lazy resources

Resources are not downloaded when they are created. Data is loaded only when it is requested.

profile = client.profile.get( "bill-gates" )

# No request has been made yet.

data = await profile.meta.data()

Collections

Collection resources provide filtering, searching, sorting and paging helpers.

profiles = await client.profile.index.collection()

for profile in profiles.search( "bill" ).order_by( "networth", descending= True ).take( 5 ):
    print( item.raw["name"], item.raw["uri"] )

Time series

Historical data can be accessed through typed time-series resources.

history = await client.profile.get( "bill-gates" ).history.series()
print( history.latest )

Time series collections support date-based navigation and cursor operations:

history.seek( "2026-01-01" )

while ( point := history.next ) is not None:
    print( point["date"], point["networth"] )

Cache behavior

The SDK includes a configurable resource cache layer that follows HTTP cache semantics. Resources are cached according to the selected cache mode and server-provided cache headers.

Supported cache modes:

  • ttl — uses the server-defined cache lifetime (Cache-Control)
  • revalidate — performs conditional requests using validators such as ETag and Last-Modified
  • session — keeps resources during the lifetime of the SDK instance

The SDK does not bypass HTTP cache validation. Expired resources are refreshed according to the configured mode to prevent serving outdated data indefinitely.

A custom cache implementation can be provided by implementing the Cache protocol. This allows applications to integrate their own storage solutions, such as databases, filesystem caches or distributed cache systems.

The cache interface requires the following operations:

  • retrieve a cached resource state
  • store a resource state
  • delete a resource
  • clear the cache
  • report the current cache size

Requirements

  • Python 3.12+
  • httpx 0.28+

License

Copyright © 2026 RTBNext
Created and maintained by Paul Köhler (komed3).
Licensed under the MIT License.

Download files

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

Source Distribution

rtbnext-1.0.1.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

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

rtbnext-1.0.1-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

File details

Details for the file rtbnext-1.0.1.tar.gz.

File metadata

  • Download URL: rtbnext-1.0.1.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rtbnext-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a9690d13142fd96707774b4f840b499f570d5946258e403f0364d60b57148996
MD5 82479747560d06cb68f8149ef0438175
BLAKE2b-256 c81752524bfd28beca2a297f8b96c972c938c613d76ece49d445e5f9d4b54c89

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbnext-1.0.1.tar.gz:

Publisher: publish.yml on rtbnext/sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rtbnext-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: rtbnext-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 38.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rtbnext-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f642aa32f0043f2317556bcf3c1f0bde1a5d91a2226713e11ce7a2d3b6d5e8d9
MD5 6960e6a0029775104f721484931ea433
BLAKE2b-256 92844a347555bd549c49b10530442510ad909f0b050d7d7c3ddf8782613d5743

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtbnext-1.0.1-py3-none-any.whl:

Publisher: publish.yml on rtbnext/sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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