openapi: 3.2.0 info: title: 2s — the (most) everything Calendar API version: '1' summary: The (most) everything API. description: 'The (most) everything API for AI agents: 575+ pay-per-call endpoints on one origin.' contact: name: 2s url: https://2s.io email: alley@2s.io x-logo: url: https://2s.io/icon-512.png altText: 2s x-guidance: 'Pay-per-call REST API for AI agents — hundreds of endpoints returning ground-truth data (US public records, company & legal identifiers, finance/SEC, crypto/web3, security & CVEs, medical codes, weather & geocoding, agriculture, energy, maritime, music, and more). Every endpoint is paid per call in USDC via x402 (Base or Solana) — no API key, no signup. Call any endpoint with no auth to get a 402 PaymentRequirements envelope, sign it (EIP-3009 on Base, partial SPL transfer on Solana), and retry with the PAYMENT-SIGNATURE header. Add ?trial=1 for one free real call per endpoint per hour to test before paying. To discover the right endpoint: GET https://2s.io/api/directory for the full catalog, or GET https://2s.io/api/search/endpoints?q= for a ranked match. Per-call price is on each operation as x-payment-info (from $0.001). Batch up to 50 calls behind one payment via POST https://2s.io/api/batch/run.' servers: - url: https://2s.io tags: - name: Calendar paths: /api/calendar/business-days: get: tags: - Calendar summary: Holiday-aware business-day calculator for 200+ countries description: 'Holiday-aware business-day calculator for 200+ countries. Three modes: pass start + addDays (signed integer) to shift a date by N business days; pass start + end to count business days between two dates (exclusive of start, inclusive of end); pass start alone to check one date (is it a business day, which holiday, next/previous business day). Query: country (ISO 3166-1 alpha-2), start (YYYY-MM-DD), optional region (subdivision code), addDays XOR end, optional weekend (comma-separated days, default sat,sun — e.g. fri,sat for the Gulf), optional types (holiday types treated as closures, default public,bank). Skipped holidays are itemized in the response. Use for payment terms, SLA deadlines, and delivery-date math.' operationId: calendar_business-days deprecated: false security: - x402Payment: [] responses: '200': description: 'Normalized envelope: items = [one calculation result], shape depends on mode (check | add | between); total = 1.' content: application/json: schema: type: object required: - data - meta properties: data: type: object properties: ok: type: boolean enum: - true items: type: array items: type: object properties: mode: type: string description: check | add | between — which calculation ran, inferred from the params. country: type: string description: Resolved ISO country code. region: type: string nullable: true description: Resolved subdivision code, or null. start: type: string description: Echoed anchor date. addDays: type: integer description: 'add mode: the requested shift.' result: type: string description: 'add mode: the resulting business date, YYYY-MM-DD.' calendarDaysSpanned: type: integer description: 'add mode: calendar days between start and result.' holidaysSkipped: type: array items: type: object properties: date: type: string name: type: string required: - date - name additionalProperties: false description: 'add mode: weekday holidays skipped along the way.' end: type: string description: 'between mode: echoed end date.' businessDays: type: integer description: 'between mode: business days after start through end.' calendarDays: type: integer description: 'between mode: calendar days between start and end.' holidaysInRange: type: array items: type: object properties: date: type: string name: type: string required: - date - name additionalProperties: false description: 'between mode: weekday holidays inside the range.' isBusinessDay: type: boolean description: 'check mode: true when start is neither weekend nor closure holiday.' isWeekend: type: boolean description: 'check mode: start falls on a configured weekend day.' isHoliday: type: boolean description: 'check mode: start is a closure holiday.' holidayNames: type: array items: type: string description: 'check mode: names of holidays on start, if any.' nextBusinessDay: type: string description: 'check mode: first business day after start.' previousBusinessDay: type: string description: 'check mode: last business day before start.' required: - mode - country - region - start additionalProperties: false total: type: integer nullable: true description: Total matching rows upstream; null when unknown. source: $ref: '#/components/schemas/Source' required: - ok - items - total - source additionalProperties: false meta: $ref: '#/components/schemas/CallMeta' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/PaymentRequired' '405': $ref: '#/components/responses/MethodNotAllowed' '500': $ref: '#/components/responses/ServerError' '502': $ref: '#/components/responses/UpstreamError' x-2s-id: calendar.business-days x-2s-version: null x-2s-price: usd: 0.0025 x-2s-accepts: - x402 x-2s-response-shape: normalized x-payment-info: price: mode: fixed currency: USD amount: '0.002500' protocols: - x402: {} parameters: - name: country in: query required: true description: ISO 3166-1 alpha-2 country code, e.g. US, DE, JP. schema: type: string minLength: 2 maxLength: 2 - name: start in: query required: true description: Anchor date, YYYY-MM-DD. schema: type: string pattern: ^\d{4}-\d{2}-\d{2}$ - name: addDays in: query required: false description: Signed number of business days to add to start (non-zero, ±3660). Mutually exclusive with end. schema: type: integer minimum: -3660 maximum: 3660 - name: end in: query required: false description: End date YYYY-MM-DD. Counts business days after start through end. Mutually exclusive with addDays. schema: type: string pattern: ^\d{4}-\d{2}-\d{2}$ - name: region in: query required: false description: Optional subdivision code — e.g. CA for US-California, BY for DE-Bavaria. schema: type: string minLength: 1 maxLength: 10 - name: weekend in: query required: false description: Optional comma-separated weekend days (mon..sun). Default "sat,sun"; use "fri,sat" for Gulf states. schema: type: string maxLength: 30 - name: types in: query required: false description: Optional comma-separated holiday types treated as business closures (public, bank, school, optional, observance). Default "public,bank". schema: type: string maxLength: 60 - $ref: '#/components/parameters/TrialMode' /api/calendar/earnings: get: tags: - Calendar summary: Earnings release calendar - which US-listed companies description: Earnings release calendar — which US-listed companies report earnings in a date window, with expected and (once reported) actual EPS and revenue, and the time of day (before/after market). Pass a from/to window (YYYY-MM-DD; defaults to the next 14 days) and optionally a ticker to filter to one company. Agents cannot recall future earnings dates — this is the schedule. Data by Finnhub. operationId: calendar_earnings deprecated: false security: - x402Payment: [] responses: '200': description: 'Normalized: items = scheduled/reported earnings events in the window.' content: application/json: schema: type: object required: - data - meta properties: data: type: object properties: ok: type: boolean enum: - true items: type: array items: type: object properties: date: type: string nullable: true description: Report date (yyyy-mm-dd). symbol: type: string nullable: true year: type: number nullable: true quarter: type: number nullable: true epsEstimate: type: number nullable: true epsActual: type: number nullable: true revenueEstimate: type: number nullable: true revenueActual: type: number nullable: true hour: type: string nullable: true description: bmo (before open), amc (after close), or dmh (during). required: - date - symbol - year - quarter - epsEstimate - epsActual - revenueEstimate - revenueActual - hour additionalProperties: false total: type: integer nullable: true description: Total matching rows upstream; null when unknown. source: $ref: '#/components/schemas/Source' meta: type: object properties: from: type: string to: type: string symbol: type: string nullable: true required: - from - to - symbol additionalProperties: false required: - ok - items - total - source additionalProperties: false meta: $ref: '#/components/schemas/CallMeta' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/PaymentRequired' '405': $ref: '#/components/responses/MethodNotAllowed' '500': $ref: '#/components/responses/ServerError' '502': $ref: '#/components/responses/UpstreamError' x-2s-id: calendar.earnings x-2s-version: null x-2s-price: usd: 0.0025 x-2s-accepts: - x402 x-2s-response-shape: normalized x-payment-info: price: mode: fixed currency: USD amount: '0.002500' protocols: - x402: {} parameters: - name: from in: query required: false description: 'Start date YYYY-MM-DD (default: today).' schema: type: string pattern: ^\d{4}-\d{2}-\d{2}$ - name: to in: query required: false description: 'End date YYYY-MM-DD (default: 14 days out).' schema: type: string pattern: ^\d{4}-\d{2}-\d{2}$ - name: ticker in: query required: false description: Filter to a single US ticker. schema: type: string minLength: 1 maxLength: 12 pattern: ^[A-Za-z][A-Za-z0-9.\-]{0,11}$ - $ref: '#/components/parameters/TrialMode' /api/calendar/holidays: get: tags: - Calendar summary: List the official holidays for a country and year, with description: 'List the official holidays for a country and year, with exact observed dates including substitute days (e.g. a Saturday July 4th observed on Friday). Query: country (ISO 3166-1 alpha-2, 200+ supported), year, optional region (subdivision code like CA for US-California or BY for DE-Bavaria), optional types filter (public, bank, school, optional, observance — comma-separated), optional lang (ISO 639-1) for localized names. Returns one item per holiday: { date (YYYY-MM-DD), name, type, substitute, rule }. Dates are computed from maintained per-country rules — including movable feasts and lunar-calendar holidays — so they stay correct year over year. Use for scheduling, delivery estimates, payment terms, and SLA math.' operationId: calendar_holidays deprecated: false security: - x402Payment: [] responses: '200': description: 'Normalized envelope: items = holidays for the requested country/region/year, sorted by date; total = count.' content: application/json: schema: type: object required: - data - meta properties: data: type: object properties: ok: type: boolean enum: - true items: type: array items: type: object properties: date: type: string description: Observed date, YYYY-MM-DD. name: type: string description: Holiday name (localized when lang is passed and a translation exists). type: type: string description: public | bank | school | optional | observance. substitute: type: boolean description: True when this entry is a substitute/observed day for a holiday falling on a weekend. rule: type: string nullable: true description: The rule the date was computed from, e.g. "3rd monday in January". required: - date - name - type - substitute - rule additionalProperties: false total: type: integer nullable: true description: Total matching rows upstream; null when unknown. source: $ref: '#/components/schemas/Source' required: - ok - items - total - source additionalProperties: false meta: $ref: '#/components/schemas/CallMeta' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/PaymentRequired' '405': $ref: '#/components/responses/MethodNotAllowed' '500': $ref: '#/components/responses/ServerError' '502': $ref: '#/components/responses/UpstreamError' x-2s-id: calendar.holidays x-2s-version: null x-2s-price: usd: 0.0025 x-2s-accepts: - x402 x-2s-response-shape: normalized x-payment-info: price: mode: fixed currency: USD amount: '0.002500' protocols: - x402: {} parameters: - name: country in: query required: true description: ISO 3166-1 alpha-2 country code, e.g. US, DE, JP. 200+ countries supported. schema: type: string minLength: 2 maxLength: 2 - name: year in: query required: true description: Calendar year (1950-2100). schema: type: integer minimum: 1950 maximum: 2100 - name: region in: query required: false description: Optional subdivision code — e.g. CA for US-California, BY for DE-Bavaria, ON for CA-Ontario. schema: type: string minLength: 1 maxLength: 10 - name: types in: query required: false description: 'Optional comma-separated holiday-type filter: public, bank, school, optional, observance. Default: all types.' schema: type: string maxLength: 60 - name: lang in: query required: false description: Optional ISO 639-1 language code for localized holiday names, e.g. en, de, fr. schema: type: string minLength: 2 maxLength: 5 - $ref: '#/components/parameters/TrialMode' /api/calendar/ipo: get: tags: - Calendar summary: IPO calendar - companies going public (or recently public) description: IPO calendar — companies going public (or recently public) in a date window, with the expected date, symbol, name, exchange, price range, number of shares, total offering value, and status (expected/priced/filed/withdrawn). Pass a from/to window (YYYY-MM-DD; defaults to a ±30-day span around today). Data by Finnhub. operationId: calendar_ipo deprecated: false security: - x402Payment: [] responses: '200': description: 'Normalized: items = IPO events in the window.' content: application/json: schema: type: object required: - data - meta properties: data: type: object properties: ok: type: boolean enum: - true items: type: array items: type: object properties: date: type: string nullable: true symbol: type: string nullable: true name: type: string nullable: true exchange: type: string nullable: true status: type: string nullable: true price: type: string nullable: true numberOfShares: type: number nullable: true totalSharesValue: type: number nullable: true required: - date - symbol - name - exchange - status - price - numberOfShares - totalSharesValue additionalProperties: false total: type: integer nullable: true description: Total matching rows upstream; null when unknown. source: $ref: '#/components/schemas/Source' meta: type: object properties: from: type: string to: type: string required: - from - to additionalProperties: false required: - ok - items - total - source additionalProperties: false meta: $ref: '#/components/schemas/CallMeta' '400': $ref: '#/components/responses/BadRequest' '402': $ref: '#/components/responses/PaymentRequired' '405': $ref: '#/components/responses/MethodNotAllowed' '500': $ref: '#/components/responses/ServerError' '502': $ref: '#/components/responses/UpstreamError' x-2s-id: calendar.ipo x-2s-version: null x-2s-price: usd: 0.0025 x-2s-accepts: - x402 x-2s-response-shape: normalized x-payment-info: price: mode: fixed currency: USD amount: '0.002500' protocols: - x402: {} parameters: - name: from in: query required: false description: 'Start date YYYY-MM-DD (default: 15 days ago).' schema: type: string pattern: ^\d{4}-\d{2}-\d{2}$ - name: to in: query required: false description: 'End date YYYY-MM-DD (default: 30 days out).' schema: type: string pattern: ^\d{4}-\d{2}-\d{2}$ - $ref: '#/components/parameters/TrialMode' components: schemas: Source: type: object description: 'Provenance of the data: upstream provider, source URL, and license.' properties: provider: type: string description: Upstream data provider. url: type: string description: Source URL or documentation link. license: type: string description: License / usage terms for the data. CallMeta: type: object description: Per-call meta envelope — endpoint id, cost, caller kind, settlement details. X402PaymentRequiredV2: type: object description: x402 v2 PaymentRequired envelope. Pick any entry from accepts[], sign for that rail, retry with the PAYMENT-SIGNATURE header. required: - x402Version - accepts properties: x402Version: type: integer const: 2 error: type: string description: Human-readable reason payment is required. resource: type: string description: The resource URL being purchased. accepts: type: array description: Payment requirement options, one per supported network (Base USDC, Solana USDC). items: type: object required: - scheme - network - amount - asset - payTo - maxTimeoutSeconds properties: scheme: type: string enum: - exact network: type: string description: CAIP-2 network id, e.g. "eip155:8453" (Base) or "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp". amount: type: string description: Price in atomic asset units (USDC has 6 decimals). asset: type: string description: Asset contract address / mint. payTo: type: string description: Treasury address to pay. maxTimeoutSeconds: type: integer extra: type: object description: 'Rail-specific extras (EVM: EIP-712 domain name/version; Solana: feePayer).' additionalProperties: true extensions: type: object description: Optional discovery metadata (e.g. bazaar input/output schemas). additionalProperties: true responses: PaymentRequired: description: Payment required. Body contains the x402 PaymentRequirements envelope with a multi-network accepts array; the per-call price is in accepts[].amount (and on the operation as x-2s-price). Sign for whichever rail you hold USDC on (EIP-3009 for Base, partial SPL transfer for Solana) and retry with the PAYMENT-SIGNATURE header (X-PAYMENT also accepted for v1 clients). content: application/json: schema: $ref: '#/components/schemas/X402PaymentRequiredV2' UpstreamError: description: Upstream provider error. MethodNotAllowed: description: Method not allowed — see `Allow` header for the supported method. ServerError: description: Internal server error. BadRequest: description: Bad request — invalid parameters. parameters: TrialMode: name: trial in: query required: false description: 'Try before you buy. Set to 1 for one free real call per endpoint per hour — no wallet or payment needed — to verify the endpoint before paying. Equivalent to sending the "X-2s-Trial: 1" request header. Works on every endpoint.' schema: type: integer enum: - 1 securitySchemes: x402Payment: type: apiKey in: header name: PAYMENT-SIGNATURE description: 'x402 protocol v2: base64-encoded PaymentPayload. Call any paid endpoint without auth to receive a 402 with a multi-network PaymentRequirements envelope. Sign for either rail: EIP-3009 transferWithAuthorization (Base USDC) OR a partial SPL token transfer (Solana USDC). Retry with PAYMENT-SIGNATURE header. X-PAYMENT is also accepted for v1 buyer clients. See https://x402.org.'