openapi: 3.0.0
info:
  title: Glassdoor Reviews API
  description: |
    Get the employee reviews of a company on Glassdoor, up to 100 per page, sorted by relevance, date, rating or helpfulness, and filtered by rating, employment type, current employees, job title, location, keyword and language.

    Each review carries its title, pros, cons, advice to management, overall and category ratings, date, job title, location, employment type, length of employment, recommendation, CEO approval, business outlook, helpful votes and employer responses. The response also returns the company's profile and its ratings: averages, percentages and a star breakdown over the reviews that match `rating`, `employment_type`, `only_current_employees`, `job_title` and `location`. `q` and `language` narrow the list of reviews but not the ratings.
  version: 1.0.0
servers:
  - url: https://www.searchapi.io/api/v1
paths:
  /search:
    get:
      summary: Glassdoor Reviews Search
      security:
        - ApiKeyAuth: []
        - ApiKeyQuery: []
      parameters:
        - name: engine
          in: query
          required: true
          description: 'Search engine. Must be set to: `glassdoor_reviews`'
          schema:
            type: string
            enum: ["glassdoor_reviews"]
        - name: company_id
          in: query
          required: true
          description: The company's Glassdoor ID, the number after `E` in its Glassdoor URL, such as `9079` for `https://www.glassdoor.com/Reviews/Google-Reviews-E9079.htm`.
          schema:
            type: string
        - name: sort_by
          in: query
          required: false
          description: Order of reviews.
          schema:
            type: string
            enum: ["relevance", "most_recent", "oldest", "highest_rated", "lowest_rated", "most_helpful"]
            default: "relevance"
        - name: rating
          in: query
          required: false
          description: Only reviews with this overall star rating, or with this rating or higher when `q` is set.
          schema:
            type: string
            enum: ["1", "2", "3", "4", "5"]
        - name: employment_type
          in: query
          required: false
          description: 'Only reviewers with these employment types, separated by commas: `regular`, `part_time`, `contract`, `intern` or `freelance`. Defaults to `regular,part_time`.'
          schema:
            type: string
        - name: only_current_employees
          in: query
          required: false
          description: Only reviews from current employees.
          schema:
            type: boolean
            default: false
        - name: job_title
          in: query
          required: false
          description: Only reviews from reviewers with this job title, such as `Software Engineer`.
          schema:
            type: string
            maxLength: 200
        - name: location
          in: query
          required: false
          description: Only reviews from this city, state or country, such as `New York`, `California` or `India`.
          schema:
            type: string
            maxLength: 200
        - name: q
          in: query
          required: false
          description: Only reviews that mention this keyword.
          schema:
            type: string
            maxLength: 200
        - name: language
          in: query
          required: false
          description: Language of the reviews.
          schema:
            type: string
            enum: ["en", "fr", "de", "it", "nl", "pt", "es"]
            default: "en"
        - name: page
          in: query
          required: false
          description: Page of results.
          schema:
            type: integer
            minimum: 1
            maximum: 10000
            default: 1
        - name: num
          in: query
          required: false
          description: Number of reviews per page.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
      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'
        '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
      required: [search_metadata, search_parameters]
      properties:
        search_metadata:
          $ref: '#/components/schemas/SearchMetadata'
        search_parameters:
          $ref: '#/components/schemas/SearchParameters'
        search_information:
          type: object
          required: [total_results]
          properties:
            total_results:
              type: integer
              description: Number of reviews matching the filters.
            all_reviews_count:
              type: integer
              description: Number of reviews of the company in every language and employment type.
            location:
              type: string
              description: Glassdoor location the reviews are filtered by.
            reviews_last_7_days:
              type: integer
              description: Number of reviews posted in the last 7 days that match every filter except `q`.
            reviews_last_30_days:
              type: integer
              description: Number of reviews posted in the last 30 days that match every filter except `q`.
        company:
          $ref: '#/components/schemas/Company'
        ratings:
          $ref: '#/components/schemas/Ratings'
        reviews:
          type: array
          items:
            $ref: '#/components/schemas/Review'
        pagination:
          type: object
          required: [current]
          properties:
            current:
              type: integer
              description: Current page.
            next:
              type: integer
              description: Next page.
            total_pages:
              type: integer
              description: Number of pages of matching reviews.
        error:
          type: string
          description: Why there are no reviews to return.
    Company:
      type: object
      required: [company_id, name]
      properties:
        company_id:
          type: integer
          description: Glassdoor company ID.
        name:
          type: string
          description: Company name.
        legal_name:
          type: string
          description: Company's full name.
        link:
          type: string
          description: Company's Glassdoor reviews page.
        logo:
          type: string
          description: Company logo URL.
        website:
          type: string
          description: Company website.
        headquarters:
          type: string
          description: Location of the headquarters.
        size:
          type: string
          description: Number of employees.
        type:
          type: string
          description: Type of company, such as public or private.
        revenue:
          type: string
          description: Yearly revenue range.
        founded:
          type: integer
          description: Year the company was founded.
        industry:
          type: string
          description: Company's industry.
        sector:
          type: string
          description: Company's sector.
        description:
          type: string
          description: Company description.
        mission:
          type: string
          description: Company mission statement.
        ceo:
          type: object
          description: CEO the reviewers' CEO approval refers to.
          required: [name]
          properties:
            name:
              type: string
              description: CEO's name.
            title:
              type: string
              description: CEO's title.
            thumbnail:
              type: string
              description: CEO's photo URL.
    Ratings:
      type: object
      description: Ratings of the reviews that match `rating`, `employment_type`, `only_current_employees`, `job_title` and `location`, whatever `q` and `language` are.
      properties:
        overall:
          type: number
          description: Average overall rating, from 1 to 5.
        reviews_count:
          type: integer
          description: Number of rated reviews the averages and percentages cover.
        work_life_balance:
          type: number
          description: Average work/life balance rating, from 1 to 5.
        culture_and_values:
          type: number
          description: Average culture and values rating, from 1 to 5.
        diversity_and_inclusion:
          type: number
          description: Average diversity and inclusion rating, from 1 to 5.
        career_opportunities:
          type: number
          description: Average career opportunities rating, from 1 to 5.
        compensation_and_benefits:
          type: number
          description: Average compensation and benefits rating, from 1 to 5.
        senior_management:
          type: number
          description: Average senior management rating, from 1 to 5.
        recommend_to_friend:
          type: integer
          description: Percentage of reviewers who would recommend the company to a friend.
        ceo_approval:
          type: integer
          description: Percentage of reviewers who approve of the CEO.
        positive_business_outlook:
          type: integer
          description: Percentage of reviewers with a positive business outlook.
        distribution:
          type: object
          description: Glassdoor's star breakdown per category, which counts a subset of `reviews_count`.
          properties:
            overall:
              $ref: '#/components/schemas/StarCounts'
            work_life_balance:
              $ref: '#/components/schemas/StarCounts'
            culture_and_values:
              $ref: '#/components/schemas/StarCounts'
            diversity_and_inclusion:
              $ref: '#/components/schemas/StarCounts'
            career_opportunities:
              $ref: '#/components/schemas/StarCounts'
            compensation_and_benefits:
              $ref: '#/components/schemas/StarCounts'
            senior_management:
              $ref: '#/components/schemas/StarCounts'
            recommend_to_friend:
              type: object
              properties:
                recommend:
                  type: integer
                  description: Number of reviewers who would recommend the company.
                would_not_recommend:
                  type: integer
                  description: Number of reviewers who would not recommend the company.
    StarCounts:
      type: object
      properties:
        one:
          type: integer
          description: Number of 1-star ratings.
        two:
          type: integer
          description: Number of 2-star ratings.
        three:
          type: integer
          description: Number of 3-star ratings.
        four:
          type: integer
          description: Number of 4-star ratings.
        five:
          type: integer
          description: Number of 5-star ratings.
    Review:
      type: object
      required: [position, review_id, link, rating, date, pros, cons, is_current_employee, is_featured, language]
      properties:
        position:
          type: integer
          description: Position of the review across pages.
        review_id:
          type: integer
          description: Glassdoor review ID.
        link:
          type: string
          description: Review page URL.
        title:
          type: string
          description: Review title.
        rating:
          type: integer
          description: Overall rating, from 1 to 5.
        date:
          type: string
          format: date
          description: Date the review was posted.
        iso_date:
          type: string
          description: 'Date and time the review was posted, as Glassdoor records it. Format: YYYY-MM-DDTHH:MM:SS'
        pros:
          type: string
          description: What the reviewer likes about the company.
        cons:
          type: string
          description: What the reviewer dislikes about the company.
        advice:
          type: string
          description: Reviewer's advice to management.
        job_title:
          type: string
          description: Reviewer's job title.
        location:
          type: string
          description: Reviewer's work location.
        employment_type:
          type: string
          enum: ["regular", "part_time", "contract", "intern", "freelance"]
          description: Reviewer's employment type.
        is_current_employee:
          type: boolean
          description: Whether the reviewer still works at the company.
        years_employed:
          type: integer
          description: Reviewer's years at the company.
        ratings:
          type: object
          properties:
            work_life_balance:
              type: integer
              description: Work/life balance rating, from 1 to 5.
            culture_and_values:
              type: integer
              description: Culture and values rating, from 1 to 5.
            diversity_and_inclusion:
              type: integer
              description: Diversity and inclusion rating, from 1 to 5.
            career_opportunities:
              type: integer
              description: Career opportunities rating, from 1 to 5.
            compensation_and_benefits:
              type: integer
              description: Compensation and benefits rating, from 1 to 5.
            senior_management:
              type: integer
              description: Senior management rating, from 1 to 5.
        is_recommended:
          type: boolean
          description: Whether the reviewer would recommend the company to a friend.
        ceo_approval:
          type: string
          enum: ["approve", "disapprove", "no_opinion"]
          description: Reviewer's opinion of the CEO.
        business_outlook:
          type: string
          enum: ["positive", "neutral", "negative"]
          description: Reviewer's outlook for the business.
        helpful_votes:
          type: integer
          description: Number of readers who found the review helpful.
        not_helpful_votes:
          type: integer
          description: Number of readers who did not find the review helpful.
        is_featured:
          type: boolean
          description: Whether Glassdoor features the review.
        language:
          type: string
          description: Language the reviews were requested in.
        employer_responses:
          type: array
          items:
            type: object
            required: [response]
            properties:
              response:
                type: string
                description: Employer's reply to the review.
              date:
                type: string
                format: date
                description: Date of the reply.
              iso_date:
                type: string
                description: 'Date and time of the reply, as Glassdoor records it. Format: YYYY-MM-DDTHH:MM:SS'
    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: Glassdoor 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
        company_id:
          type: string
        sort_by:
          type: string
          enum: ["relevance", "most_recent", "oldest", "highest_rated", "lowest_rated", "most_helpful"]
        rating:
          type: string
          enum: ["1", "2", "3", "4", "5"]
        employment_type:
          type: string
        only_current_employees:
          type: boolean
        job_title:
          type: string
        location:
          type: string
        q:
          type: string
        language:
          type: string
          enum: ["en", "fr", "de", "it", "nl", "pt", "es"]
        page:
          type: integer
        num:
          type: integer
    ErrorResponse:
      type: object
      required: [error]
      properties:
        error:
          type: string
          description: Error message describing what went wrong
