openapi: 3.0.0
info:
  title: 360 Search API
  description: |
    The 360 Search API returns a 360 Search (360搜索, so.com) results page for a query, as users in China see it. Each organic result has its position, title, the link of the page it points to, the displayed link and a snippet, plus the date and image 360 shows and whether 360 marks the site as official. The response also has the ads above, among and below the results, the news, short videos and images 360 shows on the page, related searches, the searches other people also made, and the pages of the results.

    360 Search shows up to 92 pages of results for a query. A search with no results, or a page past the last one 360 shows, returns an `error` message in place of the results.

    **Cross-linking**: The `query` of an entry in `related_searches` or `people_also_search_for` can be passed as the `q` parameter of this API.
  version: 1.0.0
servers:
  - url: https://www.searchapi.io/api/v1
paths:
  /search:
    get:
      summary: 360 Search
      security:
        - ApiKeyAuth: []
        - ApiKeyQuery: []
      parameters:
        - name: engine
          in: query
          required: true
          description: Engine to use for the search
          schema:
            type: string
            enum: ["so360"]
        - name: q
          in: query
          required: true
          description: Search query, in Chinese or English, up to 1000 characters. Operators such as `site:` are supported.
          schema:
            type: string
        - name: page
          in: query
          required: false
          description: Page number of the results, from 1 to 92.
          schema:
            type: integer
            minimum: 1
            maximum: 92
            default: 1
        - name: zero_retention
          in: query
          required: false
          description: Set to true to disable logging and persistent storage for this request. Enterprise plans only.
          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.
          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: Forbidden. Zero data retention is not available to the account, or the account requires `zero_retention=true`.
          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'
        error:
          type: string
          description: Message saying that 360 Search returned no results for the search.
        ads:
          type: array
          items:
            $ref: '#/components/schemas/Ad'
        organic_results:
          type: array
          items:
            $ref: '#/components/schemas/OrganicResult'
        top_stories:
          type: array
          items:
            $ref: '#/components/schemas/TopStory'
        inline_videos:
          type: array
          items:
            $ref: '#/components/schemas/InlineVideo'
        inline_images:
          $ref: '#/components/schemas/InlineImages'
        related_searches:
          type: array
          items:
            $ref: '#/components/schemas/RelatedSearch'
        people_also_search_for:
          type: array
          items:
            $ref: '#/components/schemas/RelatedSearch'
        pagination:
          $ref: '#/components/schemas/Pagination'
    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: 360 Search 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
          description: Engine used for the search
        q:
          type: string
          description: Search query
        page:
          type: integer
          description: Page number of the results
        zero_retention:
          type: boolean
          description: Whether zero data retention was requested
    Ad:
      type: object
      required: [position, block_position, title, tracking_link]
      properties:
        position:
          type: integer
          description: Position of the ad among the ads on the page, counted from the top
        block_position:
          type: string
          enum: [top, middle, bottom]
          description: Block of the page the ad is in, above, among or below the organic results
        title:
          type: string
          description: Title of the ad
        link:
          type: string
          description: Landing page of the ad, when 360 gives it
        tracking_link:
          type: string
          description: 360 click URL of the ad
        snippet:
          type: string
          description: Text of the ad
    OrganicResult:
      type: object
      required: [position, title, link]
      properties:
        position:
          type: integer
          description: Position of the result among the organic results
        title:
          type: string
          description: Title of the result
        link:
          type: string
          description: URL of the page the result points to
        displayed_link:
          type: string
          description: Link as 360 Search displays it
        date:
          type: string
          description: Date 360 Search shows for the result, such as `2026年8月5日` or `18小时前`
        snippet:
          type: string
          description: Text of the result
        thumbnail:
          type: string
          description: URL of the image 360 Search shows beside the result
        is_official:
          type: boolean
          description: Whether 360 Search marks the site as the official one
    TopStory:
      type: object
      required: [title, link]
      properties:
        title:
          type: string
          description: Headline of the article
        link:
          type: string
          description: URL of the article
        source:
          type: string
          description: Name of the publisher
        date:
          type: string
          description: Publish date as 360 Search shows it
    InlineVideo:
      type: object
      required: [position, title, link]
      properties:
        position:
          type: integer
          description: Position of the video among the videos
        title:
          type: string
          description: Title of the video
        link:
          type: string
          description: URL of the video
        source:
          type: string
          description: Site the video is on
        length:
          type: string
          description: Length of the video, such as `04:04`
        image:
          type: string
          description: Thumbnail of the video
    InlineImages:
      type: object
      properties:
        images:
          type: array
          items:
            $ref: '#/components/schemas/InlineImage'
        suggestions:
          type: array
          items:
            $ref: '#/components/schemas/ImageSuggestion'
    InlineImage:
      type: object
      required: [link, thumbnail]
      properties:
        link:
          type: string
          description: 360 Images page of the image
        original:
          $ref: '#/components/schemas/OriginalImage'
        thumbnail:
          type: string
          description: Thumbnail of the image
    OriginalImage:
      type: object
      properties:
        link:
          type: string
          description: URL of the original image
    ImageSuggestion:
      type: object
      required: [title, link]
      properties:
        title:
          type: string
          description: Refinement 360 Images suggests
        link:
          type: string
          description: 360 Images search for the refinement
    RelatedSearch:
      type: object
      required: [query, link]
      properties:
        query:
          type: string
          description: Search query
        link:
          type: string
          description: 360 Search URL for the query
    Pagination:
      type: object
      required: [current]
      properties:
        current:
          type: integer
          description: Current page number
        next:
          type: string
          description: URL of the next page
        previous:
          type: string
          description: URL of the previous page
        other_pages:
          type: object
          additionalProperties:
            type: string
          description: URLs of the other pages 360 Search links, by page number
    ErrorResponse:
      type: object
      required: [error]
      properties:
        error:
          type: string
          description: Error message describing what went wrong
