tap.az Python SDK

A typed Python client for tap.az, the Azerbaijani classifieds site. It signs in with an SMS code, reads the category catalog with every property of every category, checks an ad the way the tap.az form does, posts it with photos, and lists, edits, prolongs and deletes the ads of the account. There is a sync client, TapAz, and an async one, AsyncTapAz, with the same methods.

from tapaz_sdk import TapAz

with TapAz(saved_cookie) as tap:
    photo = tap.photos.upload("flat-1.jpg")
    ad = tap.ads.create(
        635,
        "3 room flat in Yasamal, renovated, close to the metro.",
        properties={"740": "3722", "737": 85, "812": "Elmler Akademiyasi metro", "900": True},
        price=150000,
        photo_ids=[photo.id],
    )
    print(ad.id, ad.status, ad.url)

Important

This is not an official tap.az product. It talks to the same GraphQL API, photo service and login service as the tap.az website, as one signed in account, with its own User-Agent. It does not solve Cloudflare challenges: when one appears you get BlockedError.

Where to go next

Installation

Python versions, a virtual environment step by step, pip, uv and Poetry.

Installation
Signing in

The SMS code login, saving the session and loading it back.

Signing in
Quickstart

Find a category, read its properties, post an ad.

Quickstart
Categories and properties

How tap.az describes an ad, and how to fill in any category.

Categories and properties
Posting ads

Every argument of create, the checks done before sending, contacts and regions.

Posting ads
Safety and retries

Which calls are retried and what an unknown outcome means.

Safety and retries
Examples

A session file, a category explorer, posting from JSON, CSV export, a prolong job, Django.

Examples
API reference

Every class, method and field.

API reference

What the SDK takes care of

  • SMS login. tap.az signs in by phone only. The SDK sends the code, checks it and turns it into a session cookie you can save and reuse.

  • The form rules. tap.az has thousands of categories, each with its own properties. Before an ad is sent, the SDK loads the category and checks every value the way the website form does: required properties, valid options, number ranges, properties that only apply after another choice, price, photo and title rules. Every problem is listed at once.

  • Ads are never posted twice. A timeout on a create, an update, a delete, a prolong or the sign in raises OutcomeUnknownError instead of trying again.

  • Reads ride over hiccups. Catalog reads, ad pages and photo uploads are retried with backoff.

  • No Cloudflare games. Challenge pages raise BlockedError. Cloudflare cookies are dropped on the way in and on the way out.

  • Typed results. Every answer is a frozen pydantic model, with the raw answer kept in .raw.

  • Everything is configurable. Addresses, paths, region and delete reason defaults, timeouts, retries and every message.