GhostContentClient
Documentation for eth_defi.vault_report.ghost.GhostContentClient Python class.
- class GhostContentClient
Bases:
objectRead published posts with the Ghost Content API.
- Parameters
api_url – Ghost site API URL, e.g.
https://example.ghost.io.content_api_key – Content API key.
timeout – HTTP timeout in seconds.
Methods summary
__init__(api_url, content_api_key[, timeout])- param api_url
fetch_latest_post_by_slug_prefix(slug_prefix)Find the most recently published post whose slug starts with a prefix.
fetch_latest_posts(nql_filter, limit)Fetch the most recently published posts that match a filter.
- __init__(api_url, content_api_key, timeout=30.0)
- fetch_latest_post_by_slug_prefix(slug_prefix)
Find the most recently published post whose slug starts with a prefix.
Uses a NQL filter
slug:~^'prefix'.- Parameters
slug_prefix (str) – E.g.
the-best-performing-stablecoin-vaults.- Returns
The latest post including its HTML body, or
None.- Return type
- fetch_latest_posts(nql_filter, limit)
Fetch the most recently published posts that match a filter.
See the Content API filtering documentation for the NQL syntax.
- Parameters
- Returns
Posts including their HTML bodies, newest first.
- Return type