forked from TrueStarHQ/api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
244 lines (233 loc) · 6.24 KB
/
Copy pathopenapi.yaml
File metadata and controls
244 lines (233 loc) · 6.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
openapi: 3.1.0
info:
title: TrueStar API
description: API for fake review detection services
version: 1.0.0
contact:
name: TrueStar Team
email: hello@truestar.pro
servers:
- url: https://api.truestar.pro
description: Production
- url: http://localhost:8080
description: Local development
paths:
/health:
get:
summary: Health check endpoint
operationId: getHealth
tags:
- System
responses:
'200':
description: Service is healthy
content:
application/json:
schema:
$ref: '#/components/schemas/HealthResponse'
/check/amazon/reviews:
post:
summary: Check Amazon reviews for authenticity
operationId: checkAmazonReviews
tags:
- Reviews
- Amazon
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CheckAmazonReviewsRequest'
responses:
'200':
description: Review check completed
content:
application/json:
schema:
$ref: '#/components/schemas/CheckAmazonReviewsResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
HealthResponse:
type: object
required:
- status
- timestamp
properties:
status:
type: string
enum: [ok]
example: ok
timestamp:
type: string
format: date-time
example: '2024-12-22T10:00:00.000Z'
CheckAmazonReviewsRequest:
type: object
required:
- reviews
properties:
reviews:
type: array
minItems: 1
description: Array of review data to analyze
items:
$ref: '#/components/schemas/AmazonReview'
CheckAmazonReviewsResponse:
type: object
required:
- result
- timestamp
properties:
result:
$ref: '#/components/schemas/ReviewChecker'
timestamp:
type: string
format: date-time
example: '2024-12-22T10:00:00.000Z'
ReviewChecker:
type: object
required:
- isFake
- confidence
- reasons
- flags
- summary
properties:
isFake:
type: boolean
description: Whether the review is likely fake
example: true
confidence:
type: number
format: float
minimum: 0
maximum: 1
description: Confidence level of the analysis (0-1)
example: 0.85
reasons:
type: array
items:
type: string
description: Specific reasons for the assessment
example: ["Excessive positivity without specific details", "Generic language patterns"]
flags:
type: array
items:
$ref: '#/components/schemas/ReviewFlag'
description: Detected red flags
example: ["excessive_positivity", "generic_language"]
summary:
type: string
description: Brief explanation of the analysis
example: "Review appears fake due to generic praise without specific product details"
AmazonReview:
type: object
required:
- id
- rating
- text
- author
- verified
properties:
id:
type: string
description: Unique identifier for the review
example: "RQ1XFNZ96Y1ST"
rating:
type: number
minimum: 1
maximum: 5
description: Review rating (1-5 stars)
example: 5
text:
type: string
minLength: 1
description: The review text content
example: "This product is amazing! Best purchase ever!"
author:
type: string
description: The reviewer's name or username
example: "John D."
verified:
type: boolean
description: Whether this is a verified purchase
example: true
date:
type: string
description: The date when the review was posted
example: "2024-01-15"
helpfulVotes:
type: number
description: Number of helpful votes
example: 42
totalVotes:
type: number
description: Total number of votes
example: 50
productVariation:
type: string
description: Product variation purchased
example: "Color: Blue, Size: Large"
isVineReview:
type: boolean
description: Whether this is a Vine review
example: false
badges:
type: array
items:
type: string
description: Badges associated with the review
example: ["Verified Purchase", "Top Contributor"]
ReviewFlag:
type: string
enum:
- generic_language
- excessive_positivity
- incentivized_review
- competitor_mention
- unnatural_language
- repetitive_phrases
- suspicious_timing
- verified_purchase_missing
description: Possible red flags in reviews
ErrorResponse:
type: object
required:
- statusCode
- error
- timestamp
properties:
statusCode:
type: integer
description: HTTP status code
example: 400
error:
type: string
description: Error message
example: "Invalid request"
details:
type: string
description: Additional error details
example: "Review text is required"
timestamp:
type: string
format: date-time
example: '2024-12-22T10:00:00.000Z'
tags:
- name: System
description: System health and status endpoints
- name: Reviews
description: Review checker endpoints
- name: Amazon