openapi: 3.0.1
servers:
  - url: https://prod.api.market/api/v1/trueway/places
info:
  title: Trueway Places API
  description: "Get Detailed information for over 180+ million places and points
    of interest (POI's): categories, names, addresses, phone numbers,
    geo-coordinates, etc."
  contact:
    name: TrueWay Team
    url: https://truewayapi.com/
    email: trueway@usa.com
  version: v1
paths:
  /PlacesService/FindPlaceByText:
    get:
      tags:
        - PlacesService
      summary: Search for places by text
      description: Search for places by text string
      parameters:
        - name: text
          in: query
          description: A text string on which to search
          required: true
          schema:
            type: string
          example: Children's Creativity Museum
        - name: language
          in: query
          description: The two-letter language code in which to return results (ISO 639-1)
          schema:
            type: string
          example: en
        - name: bounds
          in: query
          description: "The bounding box for results preference. Format:
            south,west,north,east. Coordinates: decimal degrees."
          schema:
            type: string
          example: -90.0,-180.0,90.0,180.0
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlacesResponse"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FaultResponse"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FaultResponse"
    parameters:
      - &a1
        description: API.market API Key
        in: header
        name: x-api-market-key
        value: Please Login/Signup to get an API Key
        required: true
        schema:
          type: string
  /PlacesService/FindPlacesNearby:
    get:
      tags:
        - PlacesService
      summary: Search for nearby places
      description: Search for places around location within a specified radius.
      parameters:
        - name: location
          in: query
          description: The latitude/longitude around which to retrieve places
          required: true
          schema:
            type: string
          example: 37.783366,-122.402325
        - name: radius
          in: query
          description: The distance (in meters) within which to return results. Max =
            10000 m.
          schema:
            type: integer
            format: int32
            default: 10000
          example: 180
        - name: type
          in: query
          description: The type of places that are returned
          schema:
            type: string
          example: cafe
        - name: language
          in: query
          description: The two-letter language code in which to return results (ISO 639-1)
          schema:
            type: string
          example: en
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlacesResponse"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FaultResponse"
        "500":
          description: Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FaultResponse"
    parameters:
      - *a1
components:
  schemas:
    FaultResponse:
      required:
        - error
      type: object
      properties:
        error:
          type: string
        message:
          type: string
          nullable: true
      additionalProperties: false
    Location:
      type: object
      properties:
        lat:
          type: number
          format: double
        lng:
          type: number
          format: double
      additionalProperties: false
    Place:
      required:
        - id
        - location
      type: object
      properties:
        id:
          maxLength: 32
          minLength: 32
          type: string
          description: Unique place identifier
        name:
          type: string
          description: Name of place
          nullable: true
        address:
          type: string
          description: Street address
          nullable: true
        phone_number:
          type: string
          description: Phone number
          nullable: true
        website:
          type: string
          description: Place website
          nullable: true
        location:
          $ref: "#/components/schemas/Location"
        types:
          type: array
          items:
            type: string
          description: Place types
          nullable: true
        distance:
          type: integer
          description: Distance to the place (meters). For nearby search only.
          format: int32
          nullable: true
      additionalProperties: false
    PlacesResponse:
      required:
        - results
      type: object
      properties:
        results:
          type: array
          items:
            $ref: "#/components/schemas/Place"
          description: Searching results array
      additionalProperties: false
security: {}
tags:
  - name: location
    description: Operations related to location
  - name: mapping
    description: Operations related to mapping
  - name: travel
    description: Operations related to travel
