Just Eat Search API

The Search API from Just Eat — 2 operation(s) for search.

OpenAPI Specification

just-eat-search-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  contact:
    x-twitter: JustEatUK
  description: "# Just Eat API\nJust Eat offers services for our various business partners and our consumer applications.\nHow you interact with the API depends on the services you wish to interact with.\n## Security\n### HTTPS\nAll api calls and callbacks require HTTPS. Your service will need a valid SSL certificate and be accessible via the standard SSL port (port 443).\n## Making an API request\nSome API calls require an API key, to authenticate the partner calling the API.\n```\nPUT https://uk-partnerapi.just-eat.io/orders/abcd1234 HTTP/1.1\nAuthorization: JE-API-KEY abcd123456789\n```\nOther calls require a user token in the form of a JWT.\n```\nGET https://uk.api.just-eat.io/consumer/me/orders/uk HTTP/1.1\nAuthorization: Bearer abcd123456789\n```\n\n## Date Formats\n### Date and time formats\nAll dates and times should use the [ISO 8601 standard for representation of dates and times](https://en.wikipedia.org/wiki/ISO_8601).\n\n#### For instance:\n* DueDateWithUtcOffset: `\"2015-05-26T14:52:35.5444292+01:00\"`\n  - Local time: `14:52`\n  - UTC time: `13:52`\n  - UTC offset: `+1hr` (due to daylight time saving)\n* DueDateWithUtcOffset: `\"2015-02-03T11:10:00.0000000+00:00\"`\n  - Local time: `11:10`\n  - UTC time: `11:10`\n  - UTC offset: `0` (no daylight time saving, local time is equivalent to UTC)\n\nNote that the offset may be for a timezone different to your own, so you should alway convert to your own local time for display purposes (e.g. on receipts and terminals).\n\n### Callback timestamps\nTimestamps sent to Just Eat should be recorded as the current local time (including any changes needed to account for daylight saving) with an accompanying offset that shows the difference between the recorded local time and the current UTC time.\n\nIf it is not possible to record timestamps in local time, timestamps may be recorded in UTC time with a 00:00 offset.\n## Async Webhooks\nSome of the webhooks on the platform are configured as being 'async' webhooks. These are for long-running operations, and work as follows:\n  1. Your webhook is invoked with a `?callback={returnUrl}` query string parameter. The `returnUrl` is a unique URL that you will need to send the async response to.\n  2. Return an immediate `202 Accepted` response from the webhook endpoint, to indicate that you have received the request.\n  3. Perform the long-running operation. This can be deemed either a _success_; or a _failure_.\n  4. If the result is a _**success**_, return the following:\n  ```\n  POST {returnUrl} HTTP/1.1\n\n  {\n        \"status\": \"Success\",\n        \"message\": \"{successMessage}\",\n        \"data\": {}   // webhook-specific response object\n  }\n  ```\n  5. Otherwise, if the result is a _**failure**_, return the following:\n  ```\n  POST {returnUrl} HTTP/1.1\n\n  {\n        \"status\": \"Failure\",\n        \"message\": \"{failureMessage}\",\n        \"data\": {}   // webhook-specific response object\n  }\n  ```"
  title: Just Eat UK Attempted Delivery API Search API
  version: 1.0.0
  x-apisguru-categories:
  - ecommerce
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_twitter.com_JustEatUK_profile_image.png
  x-origin:
  - format: openapi
    url: https://uk.api.just-eat.io/docs/openapi.json
    version: '3.0'
  x-providerName: just-eat.co.uk
servers:
- description: Production URL for the UK API
  url: https://uk.api.just-eat.io
- description: Production URL for the DK, ES, IE, IT and NO API
  url: https://i18n.api.just-eat.io
- description: Production URL for the AU and NZ API
  url: https://aus.api.just-eat.io
tags:
- name: Search
paths:
  /search/autocomplete/{tenant}:
    get:
      description: Provides auto-completed search terms for restaurants, cuisines and products available in a given location.
      parameters:
      - description: A valid country code, e.g. "uk".
        in: path
        name: tenant
        required: true
        schema:
          type: string
      - description: User's search term - at least one character required
        in: query
        name: searchTerm
        required: true
        schema:
          type: string
      - description: "The latitude and longitude coordinates of the location in which to search.\r\nSpecify the coordinates as latitude,longitude."
        example:
        - 51.501285
        - -0.1424422
        explode: false
        in: query
        name: latlong
        required: true
        schema:
          items:
            format: decimal
            type: number
          maxItems: 2
          minItems: 2
          type: array
        style: form
      - description: Limit the number of auto-completed terms returned by the API. Defaults to 7. Valid values 1 - 10
        in: query
        name: limit
        required: false
        schema:
          format: integer
          type: number
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutoCompleteSearchResponse'
          description: Success
          headers:
            cache-control:
              description: Information about how the response can be cached.
              schema:
                type: string
        '400':
          content:
            application/json:
              example:
                errors:
                - description: Validation failed on one or more fields
                  errorCode: 400
                  fields:
                  - latlong
                faultId: 72d7036d-990a-4f84-9efa-ef5f40f6044b
                traceId: 0HLOCKDKQPKIU
              schema:
                description: A HTTP 4xx error response
                properties:
                  fault:
                    properties:
                      errors:
                        items:
                          properties:
                            description:
                              description: Specific details about the error that may assist the you in resolving the issue
                              type: string
                            errorCode:
                              description: A code that identifies the problem type. It will be supported by human-readable documentation that identifies how to resolve the error
                              type: string
                            fields:
                              description: An array of invalid query fields
                              items:
                                type: string
                              type: array
                          type: object
                        type: array
                      faultId:
                        description: A value that helps identify this response back to logs, so we can easily find this specific fault
                        type: string
                      traceId:
                        description: A value that helps identify the trace back to logs, so that we can easily find what was happening on our system when the fault was generated
                        type: string
                    required:
                    - faultId
                    type: object
                type: object
          description: Bad Request
        '401':
          content:
            application/json:
              example:
                errors:
                - errorCode: '401'
                faultId: 72d7036d-990a-4f84-9efa-ef5f40f6044b
                traceId: 0HLOCKDKQPKIU
              schema:
                $ref: '#/components/schemas/4XXErrorSchema'
          description: Unauthorized
        '500':
          $ref: '#/components/responses/500ErrorResponse'
        '503':
          content:
            application/json:
              example:
                faultId: 72d7036d-990a-4f84-9efa-ef5f40f6044b
                traceId: 0HLOCKDKQPKIU
              schema:
                description: Service Unavailable
                properties:
                  fault:
                    properties:
                      faultId:
                        description: A value that helps identify this response back to logs, so we can easily find this specific fault
                        type: string
                      traceId:
                        description: A value that helps identify the trace back to logs, so that we can easily find what was happening on our system when the fault was generated
                        type: string
                    required:
                    - faultId
                    type: object
                type: object
          description: Service Unavailable
      summary: Get auto-completed search terms
      tags:
      - Search
      x-status: Stable
  /search/restaurants/{tenant}:
    get:
      description: "Get restaurants available in a given lat-long which match a search term.\r\nMatches can be found against the name, a cuisine or a product."
      parameters:
      - description: A valid country code, e.g. "uk".
        in: path
        name: tenant
        required: true
        schema:
          type: string
      - description: User's search term.
        in: query
        name: searchTerm
        required: true
        schema:
          type: string
      - description: "The latitude and longitude coordinates of the location in which to search.\r\nSpecify the coordinates as latitude,longitude."
        example:
        - 51.501285
        - -0.1424422
        explode: false
        in: query
        name: latlong
        required: true
        schema:
          items:
            format: decimal
            type: number
          maxItems: 2
          minItems: 2
          type: array
        style: form
      - description: "Limit the number of restaurants returned by the API.\r\nValid values are numbers between 1 and 500.\r\nIf not provided, the limit defaults to 300."
        in: query
        name: limit
        required: false
        schema:
          format: integer
          type: number
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestaurantSearchResponse'
          description: Success
          headers:
            cache-control:
              description: Information about how the response can be cached.
              schema:
                type: string
        '400':
          content:
            application/json:
              example:
                errors:
                - description: Validation failed on one or more fields
                  errorCode: 400
                  fields:
                  - latlong
                faultId: 72d7036d-990a-4f84-9efa-ef5f40f6044b
                traceId: 0HLOCKDKQPKIU
              schema:
                $ref: '#/components/schemas/4XXErrorSchema'
          description: Bad Request
        '401':
          content:
            application/json:
              example:
                errors:
                - errorCode: '401'
                faultId: 72d7036d-990a-4f84-9efa-ef5f40f6044b
                traceId: 0HLOCKDKQPKIU
              schema:
                $ref: '#/components/schemas/4XXErrorSchema'
          description: Unauthorized
        '422':
          content:
            application/json:
              example:
                errors:
                - errorCode: '422'
                faultId: 72d7036d-990a-4f84-9efa-ef5f40f6044b
                traceId: 0HLOCKDKQPKIU
              schema:
                $ref: '#/components/schemas/4XXErrorSchema'
          description: Unprocessable Entity - search term rejected
        '500':
          $ref: '#/components/responses/500ErrorResponse'
        '503':
          content:
            application/json:
              example:
                faultId: 72d7036d-990a-4f84-9efa-ef5f40f6044b
                traceId: 0HLOCKDKQPKIU
              schema:
                description: Service Unavailable
                properties:
                  fault:
                    properties:
                      faultId:
                        description: A value that helps identify this response back to logs, so we can easily find this specific fault
                        type: string
                      traceId:
                        description: A value that helps identify the trace back to logs, so that we can easily find what was happening on our system when the fault was generated
                        type: string
                    required:
                    - faultId
                    type: object
                type: object
          description: Service Unavailable
      summary: Search restaurants
      tags:
      - Search
      x-status: Stable
components:
  schemas:
    AutoCompleteSearchResponse:
      example:
        terms:
        - classification: Restaurant
          term: Pizza Palace
        - classification: Cuisine
          term: Pizza
        - classification: Dish
          term: Large Hawaiian
      properties:
        terms:
          description: Ordered list of suggested term completions
          items:
            $ref: '#/components/schemas/AutoCompleteSearchResponseItem'
          maxItems: 10
          type: array
          uniqueItems: false
      type: object
    500ErrorSchema:
      description: A HTTP 500 error response
      properties:
        fault:
          properties:
            errors:
              items:
                properties:
                  description:
                    description: If returned, the only value returned will be Internal Server Error"
                    enum:
                    - Internal Server Error
                    type: string
                type: object
              type: array
            faultId:
              description: A value that helps identify this response back to logs, so we can easily find this specific fault
              type: string
            traceId:
              description: A value that helps identify the trace back to logs, so that we can easily find what was happening on our system when the fault was generated
              type: string
          required:
          - faultId
          type: object
      type: object
    RestaurantSearchProduct:
      example:
        fullName: Chicken Korma
        price: 799
        productId: '289347'
      properties:
        fullName:
          description: The full name of the product
          type: string
        price:
          description: The price of the product
          type: number
        productId:
          description: The id of the product
          type: string
      type: object
    4XXErrorSchema:
      description: A HTTP 4xx error response
      properties:
        fault:
          properties:
            errors:
              items:
                properties:
                  description:
                    description: Specific details about the error that may assist you in resolving the issue
                    type: string
                  errorCode:
                    description: A code that identifies the problem type. It will be supported by human-readable documentation that identifies how to resolve the error
                    type: string
                type: object
              type: array
            faultId:
              description: A value that helps identify this response back to logs, so we can easily find this specific fault
              type: string
            traceId:
              description: A value that helps identify the trace back to logs, so that we can easily find what was happening on our system when the fault was generated
              type: string
          required:
          - faultId
          type: object
      type: object
    RestaurantSearchResponse:
      example:
        restaurants:
        - isSponsored: true
          products:
          - fullName: Chicken Korma
            price: 799
            productId: '289347'
          - fullName: Chicken Madras
            price: 699
            productId: '563454'
          restaurantId: '110230'
        - isSponsored: false
          products:
          - fullName: BBQ Chicken Pizza
            price: 1099
            productId: '67832'
          - fullName: Chicken Burger
            price: 899
            productId: '23567'
          restaurantId: '229390'
      properties:
        restaurants:
          description: Ordered list of restaurants
          items:
            $ref: '#/components/schemas/RestaurantSearchResponseItem'
          type: array
          uniqueItems: false
      type: object
    AutoCompleteSearchResponseItem:
      example:
        classification: Restaurant
        term: Pizza Palace
      properties:
        classification:
          description: Grouping to which term belongs
          enum:
          - Restaurant
          - Cuisine
          - Dish
          type: string
        term:
          description: Auto-completed search term
          type: string
      type: object
    RestaurantSearchResponseItem:
      example:
        isSponsored: false
        products:
        - fullName: Chicken Korma
          price: 799
          productId: '289347'
        - fullName: Chicken Madras
          price: 699
          productId: '563454'
        restaurantId: '110230'
      properties:
        isSponsored:
          description: Flag to indicate if the restaurant is sponsored, so has been promoted to the top of the results
          type: boolean
        products:
          description: Ordered list of products available from the restaurant which matched the search term
          items:
            $ref: '#/components/schemas/RestaurantSearchProduct'
          type: array
          uniqueItems: false
        restaurantId:
          description: The id of the restaurant
          type: string
      type: object
  responses:
    500ErrorResponse:
      content:
        application/json:
          example:
            errors:
            - description: Internal Server Error
            faultId: 25bbe062-c53d-4fbc-9d6c-3df6127b94fd
            traceId: H3TKh4QSJUSwVBCBqEtkKw==
          schema:
            $ref: '#/components/schemas/500ErrorSchema'
      description: Internal Server Error
  securitySchemes:
    Bearer:
      bearerFormat: JWT
      description: Bearer token authentication using a JSON Web Token (JWT).
      scheme: bearer
      type: http
    api_key:
      description: APIs for delivery partners require an API key that will have been issued to you.
      in: header
      name: Authorization
      type: apiKey
    basic_auth:
      description: A few services allow the use of basic authentication when a partner doesn't support OAuth based authentication.
      scheme: basic
      type: http
    justeat_adfs:
      description: ADFS authentication provider for internal Just Eat tools.
      openIdConnectUrl: https://adfs.just-eat.com/adfs/.well-known/openid-configuration
      type: openIdConnect
    restaurantsignup_jwt:
      bearerFormat: JWT token with payload `RestaurantId` and Role `[RestaurantRead | VerifyEmail | RestaurantWrite | FullAccess | DocumentRead]`
      description: Bearer token authentication using a JSON Web Token (JWT), used by the restaurant sign up system
      scheme: bearer
      type: http
x-tagGroups:
- name: Consumer Experience
  tags:
  - Authorization
  - Consumers
  - ConsumerOffers
  - ConsumerQueries
  - Consumer Queries Webhooks
  - ConsumerOrders
  - Search
  - Basket
  - Payments
  - Giftcards
  - Experiments
  - Vouchers
  - Promoted Placement
  - Menu
  - Recommendations
  - Location Services
- name: Manage Order Journey
  tags:
  - Order Acceptance API
  - Order Acceptance Webhooks
  - Order Delivery API
  - Order Delivery Webhooks
  - Order API
  - Order Webhooks
  - Customer Order Details
  - DeliveryFee
  - Delivery Pools API
  - Attempted Delivery API
  - Attempted Delivery Webhooks
  - Checkout
  - Courier Feedback
- name: Restaurant Management
  tags:
  - Restaurant Product
  - Restaurants
  - RestaurantOffers
  - Restaurant OrderTimes
  - Restaurants Webhooks
  - RestaurantSignup
  - RestaurantQueries
  - RestaurantQueries Webhooks
  - Restaurant Claims
  - Restaurant Events
  - Restaurant Events Webhooks
  - Restaurant API
  - Restaurant Webhooks
  - Products
  - Logistics POS Restaurants
  - Restaurant Smiley Rating