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

# Search Hacker News

> Search Hacker News stories and comments by keyword via Algolia.



## OpenAPI

````yaml get /v1/hacker-news/search
openapi: 3.1.0
info:
  title: Scrapio
  version: 1.0.0
  description: >-
    Turn any URL into structured data. Fetch raw HTML, crawl sites, extract
    structured content, interact with dynamic pages, and search the web through
    one API.
  contact:
    name: Scrapio Support
    url: https://scrapio.dev
  license:
    name: Proprietary
servers:
  - url: https://api.scrapio.dev
    description: Production
security:
  - bearerAuth: []
tags:
  - name: System
  - name: Fetch
  - name: Crawl
  - name: Map
  - name: Interact
  - name: Search
  - name: Google
  - name: Fast Search
  - name: Jobs
  - name: YouTube
  - name: Amazon
  - name: Walmart
  - name: Booking
  - name: Agoda
  - name: Airbnb
  - name: AutoTrader
  - name: ChatGPT
  - name: Perplexity
  - name: Gemini
  - name: Bing
  - name: Reddit
  - name: Instagram
  - name: Twitter
  - name: Facebook
  - name: Hacker News
  - name: GitHub
  - name: TikTok
  - name: Apple App Store
  - name: Target
  - name: Monitors
paths:
  /v1/hacker-news/search:
    get:
      tags:
        - Hacker News
      summary: Search Hacker News
      description: >-
        Full-text keyword search over Hacker News stories/comments via Algolia's
        HN Search API -- the brand/keyword-monitoring use case. `sort=relevance`
        (default) uses Algolia's `/search`; `sort=date` uses `/search_by_date`
        for chronological results. Requires a Starter plan or higher.
      operationId: searchHackerNews
      parameters:
        - name: query
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            description: Search keyword(s)
        - name: tags
          in: query
          required: false
          schema:
            description: Restrict results to these Algolia HN tags
            type: array
            items:
              type: string
              enum:
                - story
                - comment
                - poll
                - pollopt
                - show_hn
                - ask_hn
                - front_page
        - name: since
          in: query
          required: false
          schema:
            description: Only include results created after this unix timestamp (seconds)
            type: integer
            minimum: 0
            maximum: 9007199254740991
        - name: sort
          in: query
          required: false
          schema:
            description: relevance (default) uses /search, date uses /search_by_date
            type: string
            enum:
              - relevance
              - date
        - name: page
          in: query
          required: false
          schema:
            description: 0-indexed result page
            type: integer
            minimum: 0
            maximum: 9007199254740991
        - name: hits_per_page
          in: query
          required: false
          schema:
            description: Results per page, max 100
            type: integer
            exclusiveMinimum: 0
            maximum: 100
      responses:
        '200':
          description: Structured Hacker News search results.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HackerNewsSearchResponse'
        '400':
          description: Missing or invalid query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Hacker News dedicated endpoints require a Starter plan or higher.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Daily credit cap exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Hacker News upstream failed or returned an unusable response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Hacker News upstream unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: >-
            curl
            "https://api.scrapio.dev/v1/hacker-news/search?query=scrapio&sort=date"
            \
              -H "Authorization: Bearer $SCRAPIO_API_KEY"
components:
  schemas:
    HackerNewsSearchResponse:
      type: object
      properties:
        provider:
          type: string
          enum:
            - hacker_news
        request_id:
          type: string
        query:
          type: string
        hits:
          type: array
          items:
            type: object
            properties:
              object_id:
                type: string
              type:
                type: string
                enum:
                  - story
                  - comment
                  - job
                  - poll
                  - pollopt
              title:
                anyOf:
                  - type: string
                  - type: 'null'
              author:
                type: string
              url:
                anyOf:
                  - type: string
                  - type: 'null'
              points:
                anyOf:
                  - type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  - type: 'null'
              num_comments:
                anyOf:
                  - type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  - type: 'null'
              created_at:
                type: string
              story_id:
                anyOf:
                  - type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  - type: 'null'
              comment_text:
                anyOf:
                  - type: string
                  - type: 'null'
            required:
              - object_id
              - type
              - title
              - author
              - url
              - points
              - num_comments
              - created_at
              - story_id
              - comment_text
            additionalProperties: false
        page:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        total_pages:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        total_hits:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - provider
        - request_id
        - query
        - hits
        - page
        - total_pages
        - total_hits
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        request_id:
          type: string
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
        diagnostics:
          type: object
          properties:
            outcome:
              type: string
              enum:
                - failed
            retryable:
              type: boolean
            blocked:
              type: boolean
            timed_out:
              type: boolean
          required:
            - outcome
            - retryable
          additionalProperties: false
      required:
        - request_id
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````