{"openapi":"3.1.0","info":{"title":"Wikipedia Summaries & Trends API","version":"1.0.0","description":"Wikipedia article summaries and daily trending pages from the official Wikimedia REST and pageviews APIs, attributed CC BY-SA. Paid with x402 exact USDC on Base. No account is required.","contact":{"email":"support@brainiac.software"},"x-guidance":"BRAINIAC.software is a pay-per-call API for software agents. No account or API key is required.\nThis root OpenAPI is a token-light discovery index. Full request/response schemas and examples are at /api/{group}/openapi.json; x-api-groups lists every group URL.\nPayment uses x402 with exact USDC on Base (8453). Unpaid GET/HEAD/POST return 402 payment terms for discovery.\nHow to call: POST JSON → verify payTo/asset/network against /api/v1/catalog and /.well-known/x402 → pay and retry with payment-signature. Settlement only on HTTP 2xx.\nIdempotency-Key: 64 hex chars. Coverage HTTP 2xx with status complete|partial and real data is charged; failed or empty results are not charged. Free lookup: GET /api/v1/results/{result_id}.\nOutputs are drafts for human review — not official determinations or legal advice."},"servers":[{"url":"https://www.brainiac.software"}],"paths":{"/api/v1/wikipedia/summary":{"post":{"operationId":"wikipedia_summary","summary":"Wikipedia article summary","description":"Return a Wikipedia page summary (title, Wikidata id, description, extract, thumbnail, canonical URL) from the official Wikimedia REST API. Docs: https://www.brainiac.software/api/wikipedia/summary","externalDocs":{"url":"https://www.brainiac.software/api/wikipedia/summary"},"tags":["wikipedia","wiki summary","article extract","wikidata","reference","short description","thumbnail","CC BY-SA","official API","encyclopedia","page summary","canonical URL","title lookup","Wikimedia"],"x-keywords":["wikipedia","wiki summary","article extract","short description","Wikidata","thumbnail","CC BY-SA","official API","encyclopedia","page summary","canonical URL","reference","title lookup","Wikimedia"],"x-empty-json-probe":false,"x-probe-body":{"title":"Bitcoin"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300},"language":{"type":"string","minLength":2,"maxLength":24}},"required":["title"],"additionalProperties":false},"example":{"title":"Bitcoin"}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"JSON result. A settled 2xx includes payment-response. Settlement is only for HTTP 2xx with status complete or partial and real data; status failed or empty payloads return non-2xx and are not charged.","headers":{"payment-response":{"$ref":"#/components/headers/PaymentResponse"}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"displayTitle":{"type":"string"},"wikidataId":{"type":"string"},"description":{"type":"string"},"extract":{"type":"string"},"canonicalUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"license":{"type":"string"},"language":{"type":"string"},"source":{"type":"string"},"missing_items":{"type":"array","items":{}}},"additionalProperties":true},"example":{"status":"complete","title":"Bitcoin","displayTitle":"Bitcoin","wikidataId":"Q131723","description":"Decentralized cryptocurrency","extract":"Bitcoin is a decentralized digital currency that can be transferred on the peer-to-peer bitcoin network.","canonicalUrl":"https://en.wikipedia.org/wiki/Bitcoin","thumbnailUrl":"https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bitcoin.svg/320px-Bitcoin.svg.png","license":"CC BY-SA","language":"en","source":"Wikimedia REST API","missing_items":[]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/RequestTooLarge"},"500":{"$ref":"#/components/responses/OperationFailed"},"502":{"$ref":"#/components/responses/SettlementUnknown"},"503":{"$ref":"#/components/responses/PaymentsUnavailable"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.004"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/wikipedia/trending":{"post":{"operationId":"wikipedia_trending","summary":"Wikipedia trending pages","description":"Most-read Wikipedia articles for a language and day from the official Wikimedia pageviews API. Docs: https://www.brainiac.software/api/wikipedia/trending","externalDocs":{"url":"https://www.brainiac.software/api/wikipedia/trending"},"tags":["wikipedia","trending","pageviews","most read","wiki","wikipedia trending","daily rank","official API","Wikimedia","Main Page excluded","article views","what is trending","en.wikipedia","yesterday UTC","attention","ranked articles"],"x-keywords":["wikipedia trending","most read","pageviews","daily rank","official API","Wikimedia","Main Page excluded","article views","what is trending","en.wikipedia","yesterday UTC","attention","ranked articles"],"x-empty-json-probe":true,"x-probe-body":{"language":"en"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":24},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"additionalProperties":false},"example":{"language":"en"}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"JSON result. A settled 2xx includes payment-response. Settlement is only for HTTP 2xx with status complete or partial and real data; status failed or empty payloads return non-2xx and are not charged.","headers":{"payment-response":{"$ref":"#/components/headers/PaymentResponse"}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"date":{"type":"string"},"language":{"type":"string"},"articles":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"number"},"title":{"type":"string"},"views":{"type":"number"}},"additionalProperties":true}},"source":{"type":"string"},"missing_items":{"type":"array","items":{}}},"additionalProperties":true},"example":{"status":"complete","date":"2026-11-19","language":"en","articles":[{"rank":1,"title":"Grand Theft Auto VI","views":750227},{"rank":2,"title":"Wikipedia:Featured pictures","views":529699}],"source":"Wikimedia pageviews API","missing_items":[]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/RequestTooLarge"},"500":{"$ref":"#/components/responses/OperationFailed"},"502":{"$ref":"#/components/responses/SettlementUnknown"},"503":{"$ref":"#/components/responses/PaymentsUnavailable"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.004"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}}},"components":{"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}},"headers":{"PaymentResponse":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"responses":{"InvalidRequest":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"PaymentRequired":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"IdempotencyConflict":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"RequestTooLarge":{"description":"Request body exceeds the 24 MB limit. Not charged."},"SettlementUnknown":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"PaymentsUnavailable":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."},"OperationFailed":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."}},"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}}}