💰 Pricing¶
Domain TLD pricing information. This API does not require authentication.
🚀 Quick Example¶
from oinker.pricing import get_pricing
# Get pricing for all TLDs
pricing = await get_pricing()
# Check .com pricing
com = pricing["com"]
print(f".com registration: ${com.registration}")
print(f".com renewal: ${com.renewal}")
print(f".com transfer: ${com.transfer}")
# Find cheapest TLDs
sorted_by_price = sorted(
pricing.values(),
key=lambda p: float(p.registration)
)
for tld in sorted_by_price[:5]:
print(f".{tld.tld}: ${tld.registration}")
Functions¶
get_pricing¶
oinker.pricing.get_pricing
async
¶
Get default domain pricing for all supported TLDs.
This endpoint does not require authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request_timeout
|
float
|
Request timeout in seconds (default 30). |
DEFAULT_TIMEOUT
|
Returns:
| Type | Description |
|---|---|
dict[str, TLDPricing]
|
Dictionary mapping TLD names to their pricing information. |
Raises:
| Type | Description |
|---|---|
APIError
|
If the request fails. |
Example
pricing = await get_pricing() print(pricing["com"].registration) "9.68"
Source code in src/oinker/pricing/_api.py
get_pricing_sync¶
oinker.pricing.get_pricing_sync
¶
Get default domain pricing for all supported TLDs (synchronous version).
This endpoint does not require authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request_timeout
|
float
|
Request timeout in seconds (default 30). |
DEFAULT_TIMEOUT
|
Returns:
| Type | Description |
|---|---|
dict[str, TLDPricing]
|
Dictionary mapping TLD names to their pricing information. |
Raises:
| Type | Description |
|---|---|
APIError
|
If the request fails. |
Example
pricing = get_pricing_sync() print(pricing["com"].registration) "9.68"
Source code in src/oinker/pricing/_api.py
Types¶
TLDPricing¶
oinker.pricing.TLDPricing
dataclass
¶
Pricing information for a top-level domain.
Attributes:
| Name | Type | Description |
|---|---|---|
tld |
str
|
The top-level domain (e.g., "com", "net", "org"). |
registration |
str
|
Registration price as a string (e.g., "9.68"). |
renewal |
str
|
Renewal price as a string. |
transfer |
str
|
Transfer price as a string. |
from_api_response
classmethod
¶
Create from API response data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tld
|
str
|
The top-level domain name. |
required |
data
|
dict[str, Any]
|
The pricing data dictionary for this TLD. |
required |
Returns:
| Type | Description |
|---|---|
TLDPricing
|
A TLDPricing instance. |