Skip to main content

raportkrs

Klient Pythona publicznego API RaportKRS. Bez zależności, Python ≥ 3.9.

pip install raportkrs
from raportkrs import RaportKRS, RaportKRSError

api = RaportKRS("rk_live_...")            # klucz z https://raportkrs.pl/panel/api

# jedna firma (+ finanse w tym samym żądaniu)
r = api.firma("nip:5252973880", dolacz=["finanse"])
print(r.dane["nazwa"], r.dane["finanse"][0]["rachunek_zyskow_i_strat"]["przychody"], "saldo:", r.tokeny["saldo"])

# masowo — 500 NIP-ów w jednym żądaniu, płacisz tylko za znalezione
wyniki = api.batch(f"nip:{n}" for n in lista_nipow)
for w in wyniki:
    print(w["identyfikator"], w["firma"]["nazwa"] if w["firma"] else w["blad"]["kod"])

# katalog: spółki IT z Mazowsza z przychodami > 10 mln — wszystkie strony (1 token/stronę)
for f in api.firmy_wszystkie(wojewodztwo="MAZOWIECKIE", pkd_dzial="62", przychody_od=10_000_000):
    print(f["krs"], f["nazwa"], f["ostatnie_sprawozdanie"]["przychody"])

# pandas
import pandas as pd
df = pd.DataFrame(api.firmy(wojewodztwo="POMORSKIE", pkd_dzial="41", limit=1000).dane)

# zdarzenia od wczoraj, z kursorem
for z in api.zdarzenia_wszystkie(od="2026-08-27"):
    print(z["typ"], z["data"], z["firma"]["nazwa"])

# webhook zamiast pollingu
wh = api.utworz_webhook("https://moja-apka.pl/hook", zdarzenia=["zmiana_statusu"], filtry={"krs": ["0000123456"]})
print("sekret (pokazany raz):", wh.dane["sekret"])

Weryfikacja podpisu dostawy (Flask/FastAPI — użyj surowego body):

from raportkrs import weryfikuj_podpis
ok = weryfikuj_podpis(SEKRET, request.headers["X-RaportKRS-Timestamp"], request.get_data(), request.headers["X-RaportKRS-Signature"])

ETag (0 tokenów, gdy dane bez zmian): r2 = api.firma("0000123456", if_none_match=r1.etag); r2.bez_zmian.

Błędy: RaportKRSError z status, kod, szczegoly, request_id, retry_after. 429 i 5xx ponawiane automatycznie (ponowienia=2).

Dokumentacja: https://api.raportkrs.pl/docs · Regulamin: https://raportkrs.pl/regulamin-api

Metadata

Release files for raportkrs 1.1.0

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

Source distribution (sdist)

Source distribution for raportkrs 1.1.0
File Size Uploaded
raportkrs-1.1.0.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for raportkrs 1.1.0
File Interpreter ABI Platform
raportkrs-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.5 kB

Release files / raportkrs-1.1.0.tar.gz

Download URL raportkrs-1.1.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ee7127a45f32f1ffb4f7c81ab05dddd6ac53acbb28d4a92cc1ecf9f9d121992d
BLAKE2b-256 checksum
How to use checksums
4c7b1f77b6d927f359884317c491601d894b7f32d9e77a0a49d42348039204eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / raportkrs-1.1.0-py3-none-any.whl

Download URL raportkrs-1.1.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9689903f8396b1cf7a271566a6eea7535bc658c8ab6f3c65ce9f9d19858e3003
BLAKE2b-256 checksum
How to use checksums
b672872e726567d8c9610788c14fba48b3e9acca0cffd8288fb884c9a2c54fe4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.1.0 This release

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