Skip to main content

3scale REST API client in Python

3Scale REST API client in a wrapper over the 3scale API.

lint & smoke

Installing

Install and update using pip:

pip install 3scale-api

Or as a dependency using the pipenv

pipenv install 3scale-api

Usage

Client supports basic CRUD operations and it using the official 3scale API.

The API can be found at <https://yourdomain-admin.3scale.net>/p/admin/api_docs

Basic usage of the client:

from threescale_api import ThreeScaleClient, resources
from typing import List

client = ThreeScaleClient(url="myaccount.3scale.net", token="secret_token", ssl_verify=True)

# Get list of APIs/Services or any other resource
services: List[resources.Service] = client.services.list()

# Get service by it's name
test_service: resources.Service = client.services["test_service"] # or use: client.services.read_by_name(system_name)

# Get service by it's id
test_service: resources.Service = client.services[12345] # or use client.services.read(id)

# To get raw JSON response - you can use the fetch method - it takes the service id
raw_json: dict = client.services.fetch(12345)

# To create a new service (or any other resource), parameters are the same as you would provide by the documentation
new_service: resources.Service = client.services.create(system_name='my_testing_service', name="My Testing service")

# In order to update service you can either
client.services[123456].update(param="new_value")
# or
service: resources.Service = client.services[123456]
service['param'] = 'new_value'
service.update()

# To get a proxy config you can use
proxy: resources.Proxy = client.services['test_service'].proxy.read()

# To update the proxy you can either
proxy: resources.Proxy = client.services['test_service'].proxy.update(parameter_to_update='update')
# or
proxy_instance = client.services['test_service'].proxy.read()
proxy_instance['param'] = 'new_value'
proxy_instance.update()

# On the service you can access the:
service: resources.Service = client.services[123456]
service.proxy           # The PROXY client
service.mapping_rules   # mapping rules client
service.metrics         # metrics
service.app_plans       # application plans

# The proxy supports:
proxy = service.proxy.read()
proxy.promote(version=1, from_env="sandbox", to_env="production") # The promote operation
proxy.mapping_rules # The mapping rules
proxy.configs       # proxy configurations client
proxy.policies      # Policies defined for the API

Run the Tests

To run the tests you need to have installed development dependencies:

pipenv install --dev

and then run the pytest:

pipenv run pytest -v

Integration tests configuration

To run the integration tests you need to set these env variables:

THREESCALE_PROVIDER_URL='https://example-admin.3scale.net'
THREESCALE_PROVIDER_TOKEN='<test-token>'

# OPTIONAL:
THREESCALE_MASTER_URL='https://master.3scale.net'
THREESCALE_MASTER_TOKEN='<test-master-token>'

Release files for 3scale-api 0.35.4

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

Source distribution (sdist)

Source distribution for 3scale-api 0.35.4
File Size Uploaded
3scale_api-0.35.4.tar.gz 43.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for 3scale-api 0.35.4
File Interpreter ABI Platform
3scale_api-0.35.4-py3-none-any.whl Python 3 none any Details

Total release size: 101.6 kB

Release files / 3scale_api-0.35.4.tar.gz

Download URL 3scale_api-0.35.4.tar.gz
Size 43.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f475e3730e4b3d1e19cd62fa7e115118e4935c1c7163cbacdbdb454c62118a45
BLAKE2b-256 checksum
How to use checksums
d75f5188a4a90450a706e6205f39fa63d8cb8d3bcd1cc76f16fff649bb5b1f88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 14, 2026.

Transparency log

Release files / 3scale_api-0.35.4-py3-none-any.whl

Download URL 3scale_api-0.35.4-py3-none-any.whl
Size 58.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0e237a8e2cbc91098330089892699900c766c00760c70c6431c7b1bae768e28
BLAKE2b-256 checksum
How to use checksums
8796505b70ca913a1b94a22299a95e07403fed0c760e0ade06dd44d9f865814b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.35.4 This release

2 release files

0.35.3

2 release files

0.35.1

2 release files

0.35.0

2 release files

0.33.0

2 release files

0.32.0

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.29.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.19.0

2 release files

0.18.1

2 release files

0.17.0

2 release files

0.15.2

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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