api/open-api-spec.yml

166 lines · 4500 bytes

  1openapi: 3.0.0
  2info:
  3  title: Awesome Privacy API
  4  description: API for accessing information on privacy-focused services.
  5  version: 1.0.0
  6servers:
  7  - url: https://api.awesome-privacy.xyz
  8paths:
  9  /services:
 10    get:
 11      summary: Returns an array of all service objects
 12      responses:
 13        '200':
 14          description: A list of services
 15          content:
 16            application/json:
 17              schema:
 18                type: array
 19                items:
 20                  $ref: '#/components/schemas/Service'
 21  /categories:
 22    get:
 23      summary: Returns an array of all categories IDs
 24      responses:
 25        '200':
 26          description: A list of category slugs
 27          content:
 28            application/json:
 29              schema:
 30                type: array
 31                items:
 32                  type: string
 33  /search/{searchTerm}:
 34    get:
 35      summary: Returns an array of listings matching the given search term
 36      parameters:
 37        - in: path
 38          name: searchTerm
 39          required: true
 40          schema:
 41            type: string
 42          description: The term to search for
 43      responses:
 44        '200':
 45          description: A list of services matching the search term
 46          content:
 47            application/json:
 48              schema:
 49                type: array
 50                items:
 51                  $ref: '#/components/schemas/Service'
 52        '404':
 53          description: Search term not specified
 54  /{category}:
 55    get:
 56      summary: Returns an array of all section IDs within a given category
 57      parameters:
 58        - in: path
 59          name: category
 60          required: true
 61          schema:
 62            type: string
 63          description: The slug of the category
 64      responses:
 65        '200':
 66          description: A list of section slugs within the given category
 67          content:
 68            application/json:
 69              schema:
 70                type: array
 71                items:
 72                  type: string
 73        '404':
 74          description: Category not found
 75  /{category}/{section}:
 76    get:
 77      summary: Returns an array of all service objects within a given section
 78      parameters:
 79        - in: path
 80          name: category
 81          required: true
 82          schema:
 83            type: string
 84          description: The slug of the category
 85        - in: path
 86          name: section
 87          required: true
 88          schema:
 89            type: string
 90          description: The slug of the section
 91      responses:
 92        '200':
 93          description: A list of services within the specified section
 94          content:
 95            application/json:
 96              schema:
 97                type: array
 98                items:
 99                  $ref: '#/components/schemas/Service'
100        '404':
101          description: Category or section not found
102  /{category}/{section}/{service}:
103    get:
104      summary: Returns a single service object for a given category, section, and service
105      parameters:
106        - in: path
107          name: category
108          required: true
109          schema:
110            type: string
111          description: The slug of the category
112        - in: path
113          name: section
114          required: true
115          schema:
116            type: string
117          description: The slug of the section
118        - in: path
119          name: service
120          required: true
121          schema:
122            type: string
123          description: The slug of the service
124      responses:
125        '200':
126          description: A single service object
127          content:
128            application/json:
129              schema:
130                $ref: '#/components/schemas/Service'
131        '404':
132          description: Category, section, or service not found
133components:
134  schemas:
135    ShortService:
136      type: object
137      properties:
138        name:
139          type: string
140        description:
141          type: string
142        url:
143          type: string
144      required:
145        - name
146        - description
147        - url
148    Service:
149      allOf:
150        - $ref: '#/components/schemas/ShortService'
151        - type: object
152          properties:
153            github:
154              type: string
155            icon:
156              type: string
157            followWith:
158              type: string
159            securityAudited:
160              type: boolean
161            openSource:
162              type: boolean
163            acceptsCrypto:
164              type: boolean
165            tosdrId:
166              type: number