> ## Documentation Index
> Fetch the complete documentation index at: https://docs.halal.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Who am I

> The caller's plan, the key that authenticated (when one did), the
limits that apply, and today's request count split into direct and
MCP traffic.

`plan` follows the caller's **current** subscription, not the key
type: a live key on a lapsed plan reports `plan: free` and
`sandbox: true`, which is the fastest way to tell a lapsed plan from a
bad key without opening the dashboard.




## OpenAPI

````yaml GET /me
openapi: 3.1.0
info:
  title: halal.sh API
  version: 1.0.0
  description: >
    The halal.sh API provides Shariah compliance screening for public equities

    and ETFs, based on AAOIFI Shari'ah Standard No. 21.


    Unlike a black-box verdict, every determination exposes the individual

    screens, the financial ratios with their thresholds, the revenue breakdown,

    and the source filings behind each number. The Evidence Packet endpoint

    returns the full audit trail (each screen's calculation, the values it used

    and the filing they came from) for compliance, reporting, and
    reproducibility.


    ## Conventions


    - **Base URL** — `https://api.halal.sh/v1`

    - **Authentication** — send your key in the `X-API-Key` header.

    - **Envelope** — every success response is `{ "data": …, "meta": … }`. Every
      error is `{ "error": { "code", "message" } }`.
    - **Ratios** — screen `value`, `threshold`, and `buffer` are decimals
      (`0.082` means 8.2%, `0.30` means 30%). Fields named `*percentage`,
      `purity.percentage`, and holding `weight` are whole-number percentages
      (`66.74` means 66.74%). Each field documents its unit.
    - **Status** — compliance status is always `compliant`, `non-compliant`, or
      `pending`. Treat unknown future values as `pending`.
    - **Money** — values are in the instrument's reporting currency (USD for US
    filers).
  contact:
    name: halal.sh API support
    url: https://halal.sh/developers
    email: api@halal.sh
servers:
  - url: https://api.halal.sh/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Instruments
    description: Compliance, financials, evidence, history, and health for a single stock.
  - name: Screening
    description: Batch screening and search across the instrument universe.
  - name: ETFs
    description: Shariah purity and holdings breakdown for ETFs.
  - name: Methodology
    description: The screening methodology, its thresholds, and version.
  - name: Account
    description: Who is calling, on what plan, and where everything is.
paths:
  /me:
    get:
      tags:
        - Account
      summary: Who am I
      description: |
        The caller's plan, the key that authenticated (when one did), the
        limits that apply, and today's request count split into direct and
        MCP traffic.

        `plan` follows the caller's **current** subscription, not the key
        type: a live key on a lapsed plan reports `plan: free` and
        `sandbox: true`, which is the fastest way to tell a lapsed plan from a
        bad key without opening the dashboard.
      operationId: getMe
      responses:
        '200':
          description: Caller identity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    MeResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            auth:
              type: string
              enum:
                - api_key
                - session
              description: How the request authenticated.
            plan:
              type: string
              enum:
                - free
                - plus
                - enterprise
              description: >-
                The plan the limits follow, the caller's current subscription
                rather than the key type.
            sandbox:
              type: boolean
              description: Sandbox universe and sandbox limits apply.
            key:
              type: object
              nullable: true
              description: The key that authenticated; null for a signed-in session.
              properties:
                id:
                  type: string
                  format: uuid
                prefix:
                  type: string
                  example: hsh_live_d102
                type:
                  type: string
                  enum:
                    - sandbox
                    - live
                name:
                  type: string
                  nullable: true
                created_at:
                  type: string
                  format: date-time
            limits:
              type: object
              properties:
                requests_per_day:
                  type: integer
                  example: 2000
                requests_per_minute:
                  type: integer
                  example: 120
                evidence_packets_per_month:
                  type: integer
                  nullable: true
                  description: null means unlimited.
            usage:
              type: object
              properties:
                date:
                  type: string
                  format: date
                  description: UTC date the counts cover.
                requests_today:
                  type: integer
                  example: 142
                mcp_requests_today:
                  type: integer
                  example: 20
                  description: >-
                    Of `requests_today`, how many arrived through the MCP
                    server.
        meta:
          $ref: '#/components/schemas/Meta'
    Meta:
      type: object
      properties:
        request_id:
          type: string
          description: Unique ID for this request. Include it in support requests.
          example: req_abc123
        as_of:
          type: string
          format: date-time
          description: When this response was generated.
        methodology:
          type: string
          description: >
            Methodology used, as `id@version`. Present on compliance responses.

            `aaoifi-ss21` for an operating company; `aaoifi-ss57`, `aaoifi-ss20`
            or

            `halal-sh-etf-taxonomy` for a pooled vehicle decided on its
            structure

            (see `screens.structural` on the compliance resource).
          example: aaoifi-ss21@2026.1
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - bad_request
                - unauthorized
                - sandbox_restricted
                - not_found
                - rate_limit_exceeded
                - service_unavailable
                - internal_error
              example: not_found
            message:
              type: string
              example: No instrument found for symbol 'XYZ'.
            retry_after:
              type: integer
              description: Seconds until the rate limit resets (only on 429).
        meta:
          $ref: '#/components/schemas/Meta'
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: unauthorized
              message: Invalid or revoked API key.
            meta:
              request_id: req_abc123
    RateLimited:
      description: |
        Rate limit exceeded: your key's daily or per-minute allowance, or a
        per-IP limit (600 a minute on every request before its key is checked,
        60 a minute on the index and the OpenAPI document). `Retry-After` and
        `error.retry_after` give the wait in seconds whichever limit refused.
      headers:
        X-RateLimit-Limit:
          schema:
            type: integer
          description: >-
            Maximum requests allowed in the current window (a day for the key's
            quota, a minute for the per-IP limits).
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Requests remaining in the current window.
        X-RateLimit-Reset:
          schema:
            type: string
            format: date-time
          description: ISO 8601 timestamp when the current window resets.
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: rate_limit_exceeded
              message: Daily request limit (100) exceeded. Resets at midnight UTC.
              retry_after: 3600
            meta:
              request_id: req_abc123
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key

````