openapi: 3.0.0
info:
  title: Seznam Search API
  description: >-
    Search Seznam.cz, the Czech web search engine, and get its results page as JSON: organic results with sitelinks and
    featured snippets, Sklik ads above and below the results, the Wikipedia knowledge card, questions with answers, news,
    video and image carousels, related searches and spelling corrections. Up to 500 results per query, 10 or 20 per page,
    in the desktop or mobile layout. Pass a related search's query back as the q parameter to run it.
  version: 1.0.0
servers:
- url: https://www.searchapi.io/api/v1
paths:
  "/search":
    get:
      summary: Seznam Search
      security:
      - ApiKeyAuth: []
      - ApiKeyQuery: []
      parameters:
      - name: engine
        in: query
        required: true
        description: Set to seznam.
        schema:
          type: string
          enum: ["seznam"]
      - name: q
        in: query
        required: true
        description: Search query. Czech, English and other languages work, and so do operators such as site:.
        schema:
          type: string
      - name: page
        in: query
        required: false
        description: Page of results, starting at 1. Up to 500 results are available, so the last page is 50 at num 10 and 25 at num 20.
        schema:
          type: integer
          minimum: 1
          maximum: 50
          default: 1
      - name: num
        in: query
        required: false
        description: Number of results per page.
        schema:
          type: integer
          enum: [10, 20]
          default: 10
      - name: nfpr
        in: query
        required: false
        description: Set to 1 to turn off Seznam's automatic spelling correction and search the query as typed.
        schema:
          type: string
          enum: ["0", "1"]
          default: "0"
      - name: device
        in: query
        required: false
        description: Layout to search with. The mobile layout carries the phone blocks.
        schema:
          type: string
          enum: ["desktop", "mobile"]
          default: "desktop"
      - name: zero_retention
        in: query
        required: false
        description: Omit request parameters, HTML and JSON responses from storage and logs. Enterprise option.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/SearchResponse"
        '400':
          description: >-
            Validation Error. There is an issue with query parameters, such as missing required parameters or invalid values.
            Seznam can also redirect a later page to page one even when the requested page is within the allowed range.
            The API returns 400 and refunds the search credit for that redirect.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '401':
          description: Authentication Error. The API key is missing or invalid.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '403':
          description: The account requires zero retention and the request did not enable it, or a non-Enterprise account enabled zero retention.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '429':
          description: >-
            Rate Limit Exceeded. The number of allowed requests has been exceeded. Consider upgrading your plan or waiting
            for the limit to reset.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '500':
          description: Server Error. Internal server error.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '503':
          description: Timeout. We could not retrieve results in 90 seconds.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Use Bearer authentication. Format: "Bearer YOUR_API_KEY"'
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: Pass API key as query parameter
  schemas:
    SearchResponse:
      type: object
      properties:
        search_metadata:
          "$ref": "#/components/schemas/SearchMetadata"
        search_parameters:
          "$ref": "#/components/schemas/SearchParameters"
        search_information:
          "$ref": "#/components/schemas/SearchInformation"
        ads:
          type: array
          description: Sklik ads shown above and below the organic results.
          items:
            "$ref": "#/components/schemas/Ad"
        knowledge_graph:
          "$ref": "#/components/schemas/KnowledgeGraph"
        organic_results:
          type: array
          description: Organic results in the order Seznam shows them.
          items:
            "$ref": "#/components/schemas/OrganicResult"
        related_questions:
          type: array
          description: Questions Seznam answers with an excerpt from a page.
          items:
            "$ref": "#/components/schemas/RelatedQuestion"
        ai_overview:
          "$ref": "#/components/schemas/AiOverview"
        top_stories:
          type: array
          description: News articles from the news carousel.
          items:
            "$ref": "#/components/schemas/TopStory"
        inline_videos:
          type: array
          description: Videos from the video carousel.
          items:
            "$ref": "#/components/schemas/InlineVideo"
        inline_images:
          type: array
          description: Images from the image carousel.
          items:
            "$ref": "#/components/schemas/InlineImage"
        related_searches:
          type: array
          description: Searches related to the query.
          items:
            "$ref": "#/components/schemas/RelatedSearch"
        pagination:
          "$ref": "#/components/schemas/Pagination"
        error:
          type: string
          description: Message saying Seznam found no results for the query or page.
    SearchMetadata:
      type: object
      required:
      - status
      - created_at
      properties:
        id:
          type: string
          description: Unique identifier for the search request
        status:
          type: string
          description: Status of the search request
        created_at:
          type: string
          format: date-time
          description: Timestamp when the search was created
        request_time_taken:
          type: number
          description: Time taken to make the request in seconds
        parsing_time_taken:
          type: number
          description: Time taken to parse the results in seconds
        total_time_taken:
          type: number
          description: Total time taken for the search in seconds
        request_url:
          type: string
          description: Seznam URL for this search
        html_url:
          type: string
          description: URL to view HTML results
        json_url:
          type: string
          description: URL to view JSON results
    SearchParameters:
      type: object
      properties:
        engine:
          type: string
          enum: ["seznam"]
          description: Set to seznam.
        q:
          type: string
          description: Search query.
        page:
          type: integer
          minimum: 1
          maximum: 50
          description: Page of results returned, starting at 1.
        num:
          type: integer
          enum: [10, 20]
          description: Number of results per page.
        nfpr:
          type: string
          enum: ["0", "1"]
          description: Whether automatic spelling correction was turned off.
        device:
          type: string
          enum: ["desktop", "mobile"]
          description: Layout searched with.
        zero_retention:
          type: boolean
          description: Present and true when zero retention is enabled.
    SearchInformation:
      type: object
      required:
      - query_displayed
      properties:
        query_displayed:
          type: string
          description: Query shown in Seznam's search box.
        total_results:
          type: integer
          description: Estimated number of results Seznam reports for the query.
        showing_results_for:
          type: string
          description: Corrected query Seznam searched instead of the one sent.
        did_you_mean:
          type: string
          description: Corrected query Seznam suggests while searching the query as sent.
    Ad:
      type: object
      required:
      - position
      - block_position
      - title
      - link
      properties:
        position:
          type: integer
          description: Position of the ad within its block, starting at 1.
        block_position:
          type: string
          enum: ["top", "bottom"]
          description: Whether the ad is shown above or below the organic results.
        title:
          type: string
          description: Ad headlines as Seznam joins them.
        link:
          type: string
          description: Landing page of the ad.
        displayed_link:
          type: string
          description: Address the ad displays.
        tracking_link:
          type: string
          description: Seznam's click tracking URL for the ad.
        snippet:
          type: string
          description: Ad text.
        phone:
          type: string
          description: Advertiser's phone number.
        address:
          type: string
          description: Advertiser's street address and city.
        extensions:
          type: array
          description: Short callouts shown under the ad text.
          items:
            type: string
        sitelinks:
          type: array
          description: Extra links shown under the ad.
          items:
            "$ref": "#/components/schemas/AdSitelink"
    AdSitelink:
      type: object
      required:
      - title
      - link
      properties:
        title:
          type: string
          description: Text of the link.
        link:
          type: string
          description: Landing page of the link.
    KnowledgeGraph:
      type: object
      required:
      - title
      properties:
        title:
          type: string
          description: Name of the entity.
        type:
          type: string
          description: Short description of the entity under its name.
        description:
          type: string
          description: Summary of the entity from its Wikipedia article.
        source:
          "$ref": "#/components/schemas/KnowledgeGraphSource"
        thumbnail:
          type: string
          description: Image of the entity.
        facts:
          type: array
          description: Facts from the card's infobox, with Seznam's labels.
          items:
            "$ref": "#/components/schemas/KnowledgeGraphFact"
        profiles:
          type: array
          description: Social media profiles of the entity.
          items:
            "$ref": "#/components/schemas/KnowledgeGraphProfile"
        relatives:
          type: array
          description: Relatives of a person, grouped by relation.
          items:
            "$ref": "#/components/schemas/KnowledgeGraphRelative"
        people_also_search_for:
          type: array
          description: Related entities people also search for.
          items:
            "$ref": "#/components/schemas/KnowledgeGraphRelatedEntity"
    KnowledgeGraphSource:
      type: object
      required:
      - link
      properties:
        name:
          type: string
          description: Name of the source.
        link:
          type: string
          description: Link to the source article.
    KnowledgeGraphFact:
      type: object
      required:
      - label
      - value
      properties:
        label:
          type: string
          description: Label of the fact.
        value:
          type: string
          description: Value of the fact.
        link:
          type: string
          description: Link the value points to.
        value_links:
          type: array
          description: Parts of the value that Seznam links, such as a place of birth.
          items:
            "$ref": "#/components/schemas/KnowledgeGraphFactLink"
    KnowledgeGraphFactLink:
      type: object
      required:
      - text
      - link
      properties:
        text:
          type: string
          description: Text of the linked part of the value.
        link:
          type: string
          description: Website the part links to, or a Seznam search for it.
    KnowledgeGraphProfile:
      type: object
      required:
      - name
      - link
      properties:
        name:
          type: string
          description: Name of the social network.
        link:
          type: string
          description: Link to the profile.
    KnowledgeGraphRelative:
      type: object
      required:
      - relation
      - name
      - link
      properties:
        relation:
          type: string
          description: Relation to the person, as Seznam labels it.
        name:
          type: string
          description: Name of the relative.
        link:
          type: string
          description: Seznam search for the relative.
        thumbnail:
          type: string
          description: Image of the relative.
    KnowledgeGraphRelatedEntity:
      type: object
      required:
      - title
      - link
      properties:
        title:
          type: string
          description: Name of the related entity.
        subtitle:
          type: string
          description: Short description of the related entity.
        link:
          type: string
          description: Seznam search for the related entity.
        thumbnail:
          type: string
          description: Image of the related entity.
    OrganicResult:
      type: object
      required:
      - position
      - title
      - link
      - displayed_link
      properties:
        position:
          type: integer
          description: Position of the result, counting from the first page.
        title:
          type: string
          description: Title of the result, or the article headline for news results.
        link:
          type: string
          description: URL of the result.
        source:
          type: string
          description: Name of the website.
        displayed_link:
          type: string
          description: URL as Seznam displays it.
        snippet:
          type: string
          description: Text snippet of the result.
        snippet_highlighted_words:
          type: array
          description: Words of the snippet Seznam highlights.
          items:
            type: string
        iso_date:
          type: string
          format: date-time
          description: Publication time from the article or video indicated by iso_date_source, in ISO 8601.
        iso_date_source:
          type: string
          enum: ["article", "video"]
          description: Content whose publication time iso_date reports. The video may be associated with the linked page.
        author:
          type: string
          description: Author of a news article.
        favicon:
          type: string
          description: Favicon of the website.
        featured_snippet:
          type: string
          description: Answer Seznam quotes from the page above the result.
        featured_snippet_list:
          type: array
          description: Items of an answer Seznam quotes from the page above the result as a list, such as recipe steps.
          items:
            type: string
        sitelinks:
          "$ref": "#/components/schemas/Sitelinks"
    Sitelinks:
      type: object
      required:
      - inline
      properties:
        inline:
          type: array
          description: Links to sections or pages of the website.
          items:
            "$ref": "#/components/schemas/Sitelink"
    Sitelink:
      type: object
      required:
      - title
      - link
      properties:
        title:
          type: string
          description: Text of the link.
        link:
          type: string
          description: URL of the link.
    RelatedQuestion:
      type: object
      required:
      - question
      properties:
        question:
          type: string
          description: Question as Seznam shows it.
        answer:
          type: string
          description: Answer quoted from the source page.
        answer_table:
          "$ref": "#/components/schemas/RelatedQuestionAnswerTable"
        source:
          "$ref": "#/components/schemas/RelatedQuestionSource"
    RelatedQuestionAnswerTable:
      type: object
      required:
      - rows
      properties:
        rows:
          type: array
          description: Rows of a table Seznam gives as the answer, each a list of its cell texts.
          items:
            type: array
            items:
              type: string
    AiOverview:
      type: object
      description: Seznam's AI summary of the top stories.
      required:
      - text_blocks
      - markdown
      properties:
        text_blocks:
          type: array
          description: Sentences of the summary in order.
          items:
            "$ref": "#/components/schemas/AiOverviewTextBlock"
        markdown:
          type: string
          description: The summary as Markdown, with its citations and sources.
        reference_links:
          type: array
          description: Articles the summary cites.
          items:
            "$ref": "#/components/schemas/AiOverviewReferenceLink"
    AiOverviewTextBlock:
      type: object
      required:
      - type
      - answer
      properties:
        type:
          type: string
          enum:
          - paragraph
          description: Type of the block.
        answer:
          type: string
          description: Text of the sentence.
        reference_indexes:
          type: array
          description: Indexes in reference_links of the articles the sentence cites.
          items:
            type: integer
    AiOverviewReferenceLink:
      type: object
      required:
      - index
      - link
      properties:
        index:
          type: integer
          description: Position of the article in reference_links, starting at 0.
        title:
          type: string
          description: Title of the article.
        link:
          type: string
          description: URL of the article.
        favicon:
          type: string
          description: Favicon of the website.
    RelatedQuestionSource:
      type: object
      properties:
        title:
          type: string
          description: Title of the page the answer comes from.
        link:
          type: string
          description: URL of the page the answer comes from.
        displayed_link:
          type: string
          description: URL as Seznam displays it.
        favicon:
          type: string
          description: Favicon of the website.
    TopStory:
      type: object
      required:
      - position
      - title
      - link
      properties:
        position:
          type: integer
          description: Position of the article in the carousel, starting at 1.
        title:
          type: string
          description: Headline of the article.
        link:
          type: string
          description: URL of the article.
        source:
          type: string
          description: Domain of the publisher.
        date:
          type: string
          description: Age of the article as Seznam shows it, in Czech.
        iso_date:
          type: string
          format: date-time
          description: Publication date of the article in ISO 8601.
        snippet:
          type: string
          description: Summary of the article.
        thumbnail:
          type: string
          description: Image of the article.
    InlineVideo:
      type: object
      required:
      - position
      - title
      - link
      properties:
        position:
          type: integer
          description: Position of the video in the carousel, starting at 1.
        title:
          type: string
          description: Title of the video.
        link:
          type: string
          description: URL of the video.
        date:
          type: string
          description: Age of the video as Seznam shows it, in Czech.
        iso_date:
          type: string
          format: date-time
          description: Publication date of the video in ISO 8601.
        duration:
          type: string
          description: Length of the video.
        thumbnail:
          type: string
          description: Preview image of the video.
    InlineImage:
      type: object
      required:
      - position
      - original
      - thumbnail
      properties:
        position:
          type: integer
          description: Position of the image in the carousel, starting at 1.
        title:
          type: string
          description: Title of the image.
        source:
          "$ref": "#/components/schemas/InlineImageSource"
        original:
          "$ref": "#/components/schemas/InlineImageOriginal"
        thumbnail:
          type: string
          description: Thumbnail of the image.
    InlineImageSource:
      type: object
      required:
      - link
      properties:
        link:
          type: string
          description: Page the image appears on.
    InlineImageOriginal:
      type: object
      required:
      - link
      properties:
        link:
          type: string
          description: URL of the full size image.
        width:
          type: integer
          description: Width of the full size image in pixels.
        height:
          type: integer
          description: Height of the full size image in pixels.
    RelatedSearch:
      type: object
      required:
      - query
      - link
      properties:
        query:
          type: string
          description: Related search query.
        link:
          type: string
          description: Seznam search for the related query.
    Pagination:
      type: object
      required:
      - current
      properties:
        current:
          type: integer
          description: Current page number.
        previous:
          type: string
          description: Seznam URL of the previous page.
        next:
          type: string
          description: Seznam URL of the next page.
    ErrorResponse:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
