Skip to content

GAM REST API for private auctions and private auction deals#72

Open
martynaut wants to merge 3 commits into
masterfrom
rest-api
Open

GAM REST API for private auctions and private auction deals#72
martynaut wants to merge 3 commits into
masterfrom
rest-api

Conversation

@martynaut

Copy link
Copy Markdown
Collaborator

internal ID: MONDE-304

Add GAM REST (Beta) API connection

New file: sroka/api/google_ad_manager/gam_rest_api.py

Adds a connection to the Google Ad Manager REST (Beta) API, structured to
match the existing SOAP API pattern in gam_api.py.

init_gam_rest_connection(network_code) — authenticates using the same
ad_manager.json service account key and network_code from config.ini already
used by the SOAP connection. No new config entries required.

get_resource_from_admanager(resource, filter_str, page_size, order_by,
network_code) — generic paginated fetcher, analogous to
get_service_data_from_admanager on the SOAP side. Uses a resource_map to
validate the resource name and resolve it to a REST path, handles
nextPageToken-based pagination automatically, and returns a DataFrame. Raises
ValueError for unsupported resources.

Currently supported resources:

  • PrivateAuction - networks/{networkCode}/privateAuctions
  • PrivateAuctionDeal - networks/{networkCode}/privateAuctionDeals

get_private_auctions_from_admanager and
get_private_auction_deals_from_admanager — convenience wrappers over the
generic function, one per resource.

Adding future resources requires only a new entry in resource_map and an
optional wrapper function.

requirements.txt

  • Added google-auth>=2.0.0 as an explicit direct dependency. Previously it was
    only a transitive dependency (via google-auth-httplib2); the REST API uses it
    directly for AuthorizedSession and service_account.Credentials.

@martynaut martynaut requested a review from a team as a code owner June 11, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant