Skip to content

Add OpenChainBench API#2705

Open
Flotapponnier wants to merge 2 commits into
APIs-guru:mainfrom
Flotapponnier:add-openchainbench
Open

Add OpenChainBench API#2705
Flotapponnier wants to merge 2 commits into
APIs-guru:mainfrom
Flotapponnier:add-openchainbench

Conversation

@Flotapponnier

Copy link
Copy Markdown

New API Submission

API: OpenChainBench
Base URL: https://openchainbench.com
Docs: https://openchainbench.com/api/openapi.json

Description

OpenChainBench publishes daily open benchmarks for crypto infrastructure: RPC providers, oracles, bridges, L1 finality, prediction markets, and Hyperliquid builders. Data is reproducible, methodology is public, and citable Parquet snapshots are mirrored on HuggingFace with a Zenodo DOI.

Endpoints exposed:

  • /api/citable — flat index of all benchmarks
  • /api/stat/{slug} — single benchmark with rankings, sparkline, citation
  • /api/og/{slug} — OG image for a benchmark

No authentication. CORS enabled (access-control-allow-origin: *).

Maintainer

Mobula / OpenChainBench (contact@openchainbench.com)
Source and methodology: https://github.com/ChainBench/OpenChainBench

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the OpenAPI 3.1.0 specification for the OpenChainBench API, defining endpoints for listing benchmarks, retrieving individual benchmark statistics, and fetching open graph images. The review feedback highlights compatibility issues with OpenAPI 3.1.0, specifically the use of the deprecated nullable keyword which should be replaced with multi-type arrays, and a missing items definition for the rankings array property.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +99 to +100
type: number
nullable: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In OpenAPI 3.1.0, the nullable keyword is no longer supported because OpenAPI 3.1.0 aligns with JSON Schema Draft 2020-12. To define a nullable field, you should use a multi-type array (e.g., type: [number, "null"]) instead.

          type:
            - "number"
            - "null"

Comment on lines +123 to +124
type: number
nullable: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In OpenAPI 3.1.0, the nullable keyword is no longer supported because OpenAPI 3.1.0 aligns with JSON Schema Draft 2020-12. To define a nullable field, you should use a multi-type array (e.g., type: [number, "null"]) instead.

          type:
            - "number"
            - "null"

Comment on lines +127 to +128
rankings:
type: array

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The rankings property is defined as type: array but is missing the items keyword. In OpenAPI/JSON Schema, array types should specify the schema of their items. If the items can be of any type, you can use an empty object items: {}.

        rankings:
          type: array
          items: {}

- Replace deprecated 'nullable: true' with multi-type arrays
  (CitableRow.value, Stat.value)
- Add 'items' to Stat.rankings via new Ranking schema that mirrors
  what /api/stat/{slug} actually returns
@Flotapponnier

Copy link
Copy Markdown
Author

Thanks for the review. Pushed a follow-up commit (baf47ad) addressing all three findings:

  • CitableRow.value and Stat.value: { type: number, nullable: true }type: [number, "null"] (OpenAPI 3.1 / JSON Schema 2020-12).
  • Stat.rankings: added a Ranking schema as items (the spec didn't have one before; the schema now mirrors what /api/stat/{slug} actually returns — name, slug, ms.{p50,p90,p99,mean}, successRate, plus optional sampleSize / sampleHealth / dataConfidence).

The upstream source (https://openchainbench.com/api/openapi.json) is also updated in ChainBench/OpenChainBench#691 so any future re-pull stays consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant