core3.api

Documentation for eth_defi.core3.api Python module.

Fetch helpers for Core3 Projects Data API endpoints.

Thin wrappers around individual API endpoints that handle URL construction, response unwrapping, and error propagation. Each function takes a Core3Session and returns the parsed JSON response.

See Core3 API documentation for endpoint details.

Functions

fetch_index_pol_history(session[, timeout])

Fetch all-time index-level aggregate PoL history from /v1/pol/history/chart.

fetch_index_pol_history_incremental(session, ...)

Fetch ranged index-level aggregate PoL history from /v1/pol/history.

fetch_pol_category_history(session, slug[, ...])

Fetch all-time PoL category breakdown history from /v1/{slug}/pol/by_category/history/chart.

fetch_pol_category_history_incremental(...)

Fetch ranged PoL category breakdown history from /v1/{slug}/pol/by_category/history.

fetch_pol_history(session, slug[, timeout])

Fetch all-time PoL history chart from /v1/{slug}/pol/history/chart.

fetch_pol_history_incremental(session, slug, ...)

Fetch ranged PoL history from /v1/{slug}/pol/history.

fetch_project_detail(session, slug[, timeout])

Fetch full project detail from /v1/{slug}.

fetch_project_list(session[, timeout])

Fetch the full project list from /v1/list.

fetch_section_detail(session, slug, section)

Fetch a project section endpoint (security, financial, etc.).

fetch_index_pol_history(session, timeout=60.0)

Fetch all-time index-level aggregate PoL history from /v1/pol/history/chart.

Parameters
Returns

List of point dicts with score and timestamp keys.

Return type

list[dict]

fetch_index_pol_history_incremental(session, from_ts, to_ts, timeout=60.0)

Fetch ranged index-level aggregate PoL history from /v1/pol/history.

Parameters
Returns

List of point dicts with score and timestamp keys.

Return type

list[dict]

fetch_pol_category_history(session, slug, timeout=60.0)

Fetch all-time PoL category breakdown history from /v1/{slug}/pol/by_category/history/chart.

Returns a list of points, each containing a timestamp and per-category PoL scores (security, financial, operational, reputational, regulatory).

Parameters
Returns

List of point dicts with category score breakdowns.

Return type

list[dict]

fetch_pol_category_history_incremental(session, slug, from_ts, to_ts, timeout=60.0)

Fetch ranged PoL category breakdown history from /v1/{slug}/pol/by_category/history.

Parameters
  • session (eth_defi.core3.session.Core3Session) – Core3 API session.

  • slug (str) – Project slug.

  • from_ts (int) – Start unix timestamp (inclusive).

  • to_ts (int) – End unix timestamp (inclusive).

  • timeout (float) – HTTP request timeout in seconds.

Returns

List of point dicts with category score breakdowns.

Return type

list[dict]

fetch_pol_history(session, slug, timeout=60.0)

Fetch all-time PoL history chart from /v1/{slug}/pol/history/chart.

Returns a list of {score, timestamp} points, unwrapped from {"points": [...]}. Used for initial backfill.

Parameters
Returns

List of point dicts with score and timestamp keys.

Return type

list[dict]

fetch_pol_history_incremental(session, slug, from_ts, to_ts, timeout=60.0)

Fetch ranged PoL history from /v1/{slug}/pol/history.

Uses the from and to query parameters (unix timestamps in seconds) to fetch only the requested range. Used for incremental updates after the initial backfill.

Parameters
  • session (eth_defi.core3.session.Core3Session) – Core3 API session.

  • slug (str) – Project slug.

  • from_ts (int) – Start unix timestamp (inclusive).

  • to_ts (int) – End unix timestamp (inclusive).

  • timeout (float) – HTTP request timeout in seconds.

Returns

List of point dicts with score and timestamp keys.

Return type

list[dict]

fetch_project_detail(session, slug, timeout=60.0)

Fetch full project detail from /v1/{slug}.

Returns the top-level project object including description, rank, PoL score, market cap, links, top_risks, and seals.

Parameters
Returns

Project detail dict (raw JSON response).

Return type

dict

fetch_project_list(session, timeout=60.0)

Fetch the full project list from /v1/list.

Returns the unwrapped list (the API wraps it as {"list": [...]}) containing slug, name, coingecko_id, and PoL score per project.

Parameters
Returns

List of project dicts.

Return type

list[dict]

fetch_section_detail(session, slug, section, timeout=60.0)

Fetch a project section endpoint (security, financial, etc.).

Parameters
  • session (eth_defi.core3.session.Core3Session) – Core3 API session.

  • slug (str) – Project slug.

  • section (str) – Section name: 'security', 'financial', 'operational', 'reputational', or 'regulatory'.

  • timeout (float) – HTTP request timeout in seconds.

Returns

Section detail dict (raw JSON response).

Return type

dict