Interaction¶
cyhole.dex_screener.DexScreener
¶
DexScreener(headers: Any | None = None)
Bases: Interaction
flowchart TD
cyhole.dex_screener.DexScreener[DexScreener]
cyhole.core.interaction.Interaction[Interaction]
cyhole.core.interaction.Interaction --> cyhole.dex_screener.DexScreener
click cyhole.dex_screener.DexScreener href "" "cyhole.dex_screener.DexScreener"
click cyhole.core.interaction.Interaction href "" "cyhole.core.interaction.Interaction"
Class used to connect DexScreener API.
No API key is required for the public endpoints documented here.
Example
import asyncio
from cyhole.dex_screener import DexScreener
dex = DexScreener()
# sync
response = dex.client.get_token_profiles_latest()
print(response.root[0].chain_id)
# async
async def main():
async with dex.async_client as client:
response = await client.get_search("SOL/USDC")
print(response.pairs[0].pair_address)
asyncio.run(main())
Source code in src/cyhole/dex_screener/interaction.py
48 49 50 51 52 | |
_get_token_profiles_latest
¶
_get_token_profiles_latest(
sync: Literal[True],
) -> GetTokenProfilesLatestResponse
_get_token_profiles_latest(
sync: Literal[False],
) -> Coroutine[None, None, GetTokenProfilesLatestResponse]
_get_token_profiles_latest(
sync: bool,
) -> (
GetTokenProfilesLatestResponse
| Coroutine[None, None, GetTokenProfilesLatestResponse]
)
This function refers to the GET Token Profiles Latest API endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if True run synchronously, else return a coroutine. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GetTokenProfilesLatestResponse |
GetTokenProfilesLatestResponse | Coroutine[None, None, GetTokenProfilesLatestResponse]
|
list of the newest token profiles. |
Raises:
| Type | Description |
|---|---|
DexScreenerException
|
if the API returns an error. |
Source code in src/cyhole/dex_screener/interaction.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
_get_community_takeover
¶
_get_community_takeover(
sync: Literal[True],
) -> GetCommunityTakeoverResponse
_get_community_takeover(
sync: Literal[False],
) -> Coroutine[None, None, GetCommunityTakeoverResponse]
_get_community_takeover(
sync: bool,
) -> (
GetCommunityTakeoverResponse
| Coroutine[None, None, GetCommunityTakeoverResponse]
)
This function refers to the GET Community Takeovers Latest API endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if True run synchronously, else return a coroutine. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GetCommunityTakeoverResponse |
GetCommunityTakeoverResponse | Coroutine[None, None, GetCommunityTakeoverResponse]
|
list of the latest community takeovers. |
Raises:
| Type | Description |
|---|---|
DexScreenerException
|
if the API returns an error. |
Source code in src/cyhole/dex_screener/interaction.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
_get_ads_latest
¶
_get_ads_latest(
sync: Literal[True],
) -> GetAdsLatestResponse
_get_ads_latest(
sync: Literal[False],
) -> Coroutine[None, None, GetAdsLatestResponse]
_get_ads_latest(
sync: bool,
) -> (
GetAdsLatestResponse
| Coroutine[None, None, GetAdsLatestResponse]
)
This function refers to the GET Ads Latest API endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if True run synchronously, else return a coroutine. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GetAdsLatestResponse |
GetAdsLatestResponse | Coroutine[None, None, GetAdsLatestResponse]
|
list of the latest advertisements. |
Raises:
| Type | Description |
|---|---|
DexScreenerException
|
if the API returns an error. |
Source code in src/cyhole/dex_screener/interaction.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
_get_token_boosts_latest
¶
_get_token_boosts_latest(
sync: Literal[True],
) -> GetTokenBoostsLatestResponse
_get_token_boosts_latest(
sync: Literal[False],
) -> Coroutine[None, None, GetTokenBoostsLatestResponse]
_get_token_boosts_latest(
sync: bool,
) -> (
GetTokenBoostsLatestResponse
| Coroutine[None, None, GetTokenBoostsLatestResponse]
)
This function refers to the GET Token Boosts Latest API endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if True run synchronously, else return a coroutine. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GetTokenBoostsLatestResponse |
GetTokenBoostsLatestResponse | Coroutine[None, None, GetTokenBoostsLatestResponse]
|
list of the latest boosted tokens. |
Raises:
| Type | Description |
|---|---|
DexScreenerException
|
if the API returns an error. |
Source code in src/cyhole/dex_screener/interaction.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
_get_token_boosts_top
¶
_get_token_boosts_top(
sync: Literal[True],
) -> GetTokenBoostsTopResponse
_get_token_boosts_top(
sync: Literal[False],
) -> Coroutine[None, None, GetTokenBoostsTopResponse]
_get_token_boosts_top(
sync: bool,
) -> (
GetTokenBoostsTopResponse
| Coroutine[None, None, GetTokenBoostsTopResponse]
)
This function refers to the GET Token Boosts Top API endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if True run synchronously, else return a coroutine. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GetTokenBoostsTopResponse |
GetTokenBoostsTopResponse | Coroutine[None, None, GetTokenBoostsTopResponse]
|
list of tokens with the most active boosts. |
Raises:
| Type | Description |
|---|---|
DexScreenerException
|
if the API returns an error. |
Source code in src/cyhole/dex_screener/interaction.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
_get_orders
¶
_get_orders(
sync: Literal[True], chain_id: str, token_address: str
) -> GetOrdersResponse
_get_orders(
sync: Literal[False], chain_id: str, token_address: str
) -> Coroutine[None, None, GetOrdersResponse]
_get_orders(
sync: bool, chain_id: str, token_address: str
) -> (
GetOrdersResponse
| Coroutine[None, None, GetOrdersResponse]
)
This function refers to the GET Orders API endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if True run synchronously, else return a coroutine. |
required |
chain_id
|
str
|
blockchain identifier (e.g. |
required |
token_address
|
str
|
token contract address. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GetOrdersResponse |
GetOrdersResponse | Coroutine[None, None, GetOrdersResponse]
|
list of paid orders for the given token. |
Raises:
| Type | Description |
|---|---|
DexScreenerException
|
if the API returns an error. |
Source code in src/cyhole/dex_screener/interaction.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | |
_get_pairs
¶
_get_pairs(
sync: Literal[True], chain_id: str, pair_id: str
) -> GetPairsResponse
_get_pairs(
sync: Literal[False], chain_id: str, pair_id: str
) -> Coroutine[None, None, GetPairsResponse]
_get_pairs(
sync: bool, chain_id: str, pair_id: str
) -> (
GetPairsResponse
| Coroutine[None, None, GetPairsResponse]
)
This function refers to the GET Pairs API endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if True run synchronously, else return a coroutine. |
required |
chain_id
|
str
|
blockchain identifier (e.g. |
required |
pair_id
|
str
|
pair contract address. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GetPairsResponse |
GetPairsResponse | Coroutine[None, None, GetPairsResponse]
|
pair data for the given chain and pair address. |
Raises:
| Type | Description |
|---|---|
DexScreenerException
|
if the API returns an error. |
Source code in src/cyhole/dex_screener/interaction.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
_get_tokens
¶
_get_tokens(
sync: Literal[True], chain_id: str, token_addresses: str
) -> GetTokensResponse
_get_tokens(
sync: Literal[False],
chain_id: str,
token_addresses: str,
) -> Coroutine[None, None, GetTokensResponse]
_get_tokens(
sync: bool, chain_id: str, token_addresses: str
) -> (
GetTokensResponse
| Coroutine[None, None, GetTokensResponse]
)
This function refers to the GET Tokens API endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if True run synchronously, else return a coroutine. |
required |
chain_id
|
str
|
blockchain identifier (e.g. |
required |
token_addresses
|
str
|
comma-separated token addresses (up to 30). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GetTokensResponse |
GetTokensResponse | Coroutine[None, None, GetTokensResponse]
|
list of pairs for the given token addresses. |
Raises:
| Type | Description |
|---|---|
DexScreenerException
|
if the API returns an error. |
Source code in src/cyhole/dex_screener/interaction.py
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | |
_get_token_pairs
¶
_get_token_pairs(
sync: Literal[True], chain_id: str, token_address: str
) -> GetTokenPairsResponse
_get_token_pairs(
sync: Literal[False], chain_id: str, token_address: str
) -> Coroutine[None, None, GetTokenPairsResponse]
_get_token_pairs(
sync: bool, chain_id: str, token_address: str
) -> (
GetTokenPairsResponse
| Coroutine[None, None, GetTokenPairsResponse]
)
This function refers to the GET Token Pairs API endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if True run synchronously, else return a coroutine. |
required |
chain_id
|
str
|
blockchain identifier (e.g. |
required |
token_address
|
str
|
token contract address. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GetTokenPairsResponse |
GetTokenPairsResponse | Coroutine[None, None, GetTokenPairsResponse]
|
list of all pools for the given token. |
Raises:
| Type | Description |
|---|---|
DexScreenerException
|
if the API returns an error. |
Source code in src/cyhole/dex_screener/interaction.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | |
_get_search
¶
_get_search(
sync: Literal[True], query: str
) -> GetSearchResponse
_get_search(
sync: Literal[False], query: str
) -> Coroutine[None, None, GetSearchResponse]
_get_search(
sync: bool, query: str
) -> (
GetSearchResponse
| Coroutine[None, None, GetSearchResponse]
)
This function refers to the GET Search API endpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sync
|
bool
|
if True run synchronously, else return a coroutine. |
required |
query
|
str
|
search query string (e.g. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GetSearchResponse |
GetSearchResponse | Coroutine[None, None, GetSearchResponse]
|
matching pairs for the given query. |
Raises:
| Type | Description |
|---|---|
DexScreenerException
|
if the API returns an error. |
Source code in src/cyhole/dex_screener/interaction.py
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |