-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
3505 lines (3323 loc) · 117 KB
/
openapi.yaml
File metadata and controls
3505 lines (3323 loc) · 117 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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: AlsoAsked
description: >-
<!-- focus: false -->

## Overview
The **AlsoAsked API** offers developers access to 'People Also Ask' search
results. This API provides insights into
frequently asked questions related to specific search queries.
## Features
With the **AlsoAsked API**, you can:
- Conduct synchronous (waiting for completion) or asynchronous (immediate
return with ID; updates via webhooks)
searches.
- Retrieve search results.
- View your past search history.
- Use webhooks to receive updates on search status, from start to completion
or any failures.
- Access account details, including the count of remaining credits.
## Requirements
A **Pro subscription** is necessary to use the live API. For developers in
the initial stages, our sandbox API
provides a testing environment without returning actual 'People Also Ask'
results. This allows for development and
testing before committing to a **Pro subscription**.
For more on the **Pro subscription**, visit our [pricing
page](https://alsoasked.com/pricing).
## Support
If you have questions, issues, or feedback, please contact us at
[[email protected]](mailto:[email protected]).
license:
name: Proprietary
url: https://alsoasked.com/eula
termsOfService: https://alsoasked.com/eula
contact:
name: AlsoAsked Support
email: [email protected]
url: https://help.alsoasked.com
version: 1.0.0
servers:
- url: https://alsoaskedapi.com/v1
description: Live
- url: https://sandbox.alsoaskedapi.com/v1
description: Sandbox
tags:
- name: Account
description: |
Operations related to managing an account.
- name: Search
description: |
Operations related to searches.
paths:
/account:
get:
operationId: getAccount
tags:
- Account
summary: Get account information
description: |
Get information about the current user's account.
security:
- apiKey: []
responses:
'200':
$ref: '#/components/responses/GetAccount'
'401':
$ref: '#/components/responses/MissingApiKeyError'
'402':
$ref: '#/components/responses/InsufficientPlanError'
'403':
$ref: '#/components/responses/ForbiddenError'
'429':
$ref: '#/components/responses/RateLimitExceededError'
'500':
$ref: '#/components/responses/InternalServerError'
'503':
$ref: '#/components/responses/UnderMaintenanceError'
/search:
get:
operationId: listSearches
tags:
- Search
summary: List searches
description: >
Get a paginated list of searches performed by the current user, sorted
by the date they were created, with the most
recent searches appearing first.
security:
- apiKey: []
parameters:
- $ref: '#/components/parameters/count'
- $ref: '#/components/parameters/page'
responses:
'200':
$ref: '#/components/responses/ListSearches'
'401':
$ref: '#/components/responses/MissingApiKeyError'
'402':
$ref: '#/components/responses/InsufficientPlanError'
'403':
$ref: '#/components/responses/ForbiddenError'
'422':
$ref: '#/components/responses/ValidationError'
'429':
$ref: '#/components/responses/RateLimitExceededError'
'500':
$ref: '#/components/responses/InternalServerError'
'503':
$ref: '#/components/responses/UnderMaintenanceError'
post:
operationId: performSearch
tags:
- Search
summary: Perform search
description: >
Perform a search request.
The search request is performed either synchronously, meaning the
request hangs until the
search has completed, or asynchronously, meaning the request returns
immediately, which is determined by the `async`
request parameter.
If the search request completes successfully, as determined by the
`status` property, the search
results are returned in the response body.
Synchronous requests wait for a maximum of 90 seconds for the search to
complete, until which point the response is returned as if it was an
asynchronous request.
security:
- apiKey: []
requestBody:
$ref: '#/components/requestBodies/PerformSearch'
responses:
'200':
$ref: '#/components/responses/PerformSearch'
'400':
$ref: '#/components/responses/InvalidBodyError'
'401':
$ref: '#/components/responses/MissingApiKeyError'
'402':
$ref: '#/components/responses/PaymentRequiredError'
'403':
$ref: '#/components/responses/ForbiddenError'
'422':
$ref: '#/components/responses/ValidationError'
'429':
$ref: '#/components/responses/RateLimitExceededError'
'500':
$ref: '#/components/responses/InternalServerError'
'503':
$ref: '#/components/responses/UnderMaintenanceError'
/search/webhook-example:
post:
operationId: searchWebhookExample
tags:
- Search
summary: Search webhook example
description: >
This is an **example** of a web hook endpoint used to receive
notifications when a search request's status changes.
The `/search/webhook-example` doesn't exist, but is used to demonstrate
how to implement a webhook endpoint to
receive notifications when a search request's status changes, alongside
the headers and request body that will be
sent to the webhook endpoint.
parameters:
- $ref: '#/components/parameters/X-AlsoAsked-Credits'
- $ref: '#/components/parameters/X-AlsoAsked-Api-Version'
- $ref: '#/components/parameters/X-AlsoAsked-Signature'
- $ref: '#/components/parameters/X-AlsoAsked-Timestamp'
- $ref: '#/components/parameters/X-AlsoAsked-Webhook-Event'
- $ref: '#/components/parameters/X-AlsoAsked-Environment'
requestBody:
$ref: '#/components/requestBodies/StatusChangedWebhook'
responses:
'200':
description: |
The webhook notification was received successfully.
'204':
description: |
The webhook notification was received successfully.
/search/{searchId}:
get:
operationId: getSearch
tags:
- Search
summary: Get search
description: >
Get the details of a search request, and if the search request has
completed successfully, obtain the search results.
security:
- apiKey: []
parameters:
- $ref: '#/components/parameters/searchId'
responses:
'200':
$ref: '#/components/responses/GetSearch'
'401':
$ref: '#/components/responses/MissingApiKeyError'
'402':
$ref: '#/components/responses/InsufficientPlanError'
'403':
$ref: '#/components/responses/ForbiddenError'
'404':
$ref: '#/components/responses/NotFoundError'
'429':
$ref: '#/components/responses/RateLimitExceededError'
'500':
$ref: '#/components/responses/InternalServerError'
'503':
$ref: '#/components/responses/UnderMaintenanceError'
delete:
operationId: deleteSearch
tags:
- Search
summary: Delete search
description: >
Delete a search request. The search results will be deleted from the
cache and the search result's term masked in the
search history.
security:
- apiKey: []
parameters:
- $ref: '#/components/parameters/searchId'
responses:
'204':
$ref: '#/components/responses/DeleteSearch'
'401':
$ref: '#/components/responses/MissingApiKeyError'
'402':
$ref: '#/components/responses/InsufficientPlanError'
'403':
$ref: '#/components/responses/ForbiddenError'
'404':
$ref: '#/components/responses/NotFoundError'
'429':
$ref: '#/components/responses/RateLimitExceededError'
'500':
$ref: '#/components/responses/InternalServerError'
'503':
$ref: '#/components/responses/UnderMaintenanceError'
components:
headers:
X-AlsoAsked-Credits:
description: |
The number of credits remaining in the account.
schema:
type: integer
format: int64
minimum: 0
example: 100
X-RateLimit-Remaining:
description: |
The number of requests remaining in the current rate limit window.
schema:
type: integer
format: int64
minimum: 0
example: 984
X-RateLimit-Limit:
description: >
The maximum number of requests that can be made in the current rate
limit window.
schema:
type: integer
format: int64
minimum: 0
example: 1000
Retry-After:
description: >
The date and time (in UTC) at which a new request will be permitted, in
the format "Date: <day-name>, <day> <month>
<year> <hour>:<minute>:<second> GMT" (RFC 1123 format).
schema:
type: string
format: rfc1123-date-time
example: Thu, 11 May 2023 07:28:00 GMT
X-RateLimit-Reset:
description: >
The time at which the current rate limit window resets in UTC epoch
seconds.
schema:
type: integer
format: int64
minimum: 0
example: 1672531200
schemas:
Account:
title: Account
type: object
description: >
The account object is returned in the response body of any request that
results in the details of an account being
returned.
properties:
id:
type: string
pattern: ^[a-zA-Z0-9]{32}$
description: |
The unique identifier for the account.
example: 6G8QgoK9ar0E1pB7Rl0LN5mxljdAvBWb
name:
type: string
description: |
The human-readable name for the account.
example: Mantis Toboggan
email:
type: string
format: email
description: |
The email address associated with the account.
example: [email protected]
plan_type:
type: string
description: >
The type of plan that the account, or the account's team owner, is
subscribed to.
enum:
- free
- basic
- lite
- pro
example: pro
credits:
type: integer
format: int64
minimum: 0
description: >
The number of credits remaining in the account. This is the sum of
the account's web credits and API credits.
example: 100
web_credits:
type: integer
format: int64
minimum: 0
description: >
The number of web credits remaining in the account. Web credits are
used to pay for both web requests through the
AlsoAsked website and API requests through the AlsoAsked API.
example: 100
api_credits:
type: integer
format: int64
minimum: 0
description: >
The number of API credits remaining in the account. API credits are
used to pay for API requests through the
AlsoAsked API, once the account's web credits have been exhausted.
example: 100
credits_reset_at:
type: string
format: date-time
description: >
The account credit reset date is the date and time at which the
account credits will be reset to default.
example: '2023-02-01T00:00:00Z'
registered_at:
type: string
format: date-time
description: >
The account registration date is the date and time at which the
account was registered.
example: '2023-01-01T00:00:00Z'
example:
id: 6G8QgoK9ar0E1pB7Rl0LN5mxljdAvBWb
name: Mantis Toboggan
email: [email protected]
plan_type: pro
credits: 110
web_credits: 100
api_credits: 10
credits_reset_at: '2023-02-01T00:00:00Z'
registered_at: '2023-01-01T00:00:00Z'
Error:
title: Error
type: object
description: >
The error object is returned in the response body of any request that
results in an error.
properties:
status:
type: string
description: >
The error status is an identifier for the type of error that
occurred.
enum:
- internal_server
- invalid_api_key
- missing_api_key
- rate_limit_exceeded
- under_maintenance
- not_found
- validation
- insufficient_credits
- invalid_body
- insufficient_plan
- api_access_disabled
example: internal_server
message:
type: string
description: >
A human-readable message describing the error. This message is
intended to be read by a developer and is
not suitable for display to an end user.
example:
status: internal_server
message: An internal server error has occurred.
InvalidApiKeyError:
title: Invalid Api Key Error
type: object
description: >
The API key provided in the X-Api-Key request header is invalid. This
error is returned when the API key provided in
the request header has either been deleted or doesn't exist.
properties:
status:
type: string
description: >
The error status is an identifier for the type of error that
occurred.
enum:
- internal_server
- invalid_api_key
- missing_api_key
- rate_limit_exceeded
- under_maintenance
- not_found
- validation
- insufficient_credits
- invalid_body
- insufficient_plan
- api_access_disabled
example: invalid_api_key
pattern: ^invalid_api_key$
message:
type: string
description: >
A human-readable message describing the error. This message is
intended to be read by a developer and is
not suitable for display to an end user.
example: The API key provided is invalid.
example:
status: invalid_api_key
message: The API key provided is invalid.
ApiAccessDisabledError:
title: Api Access Disabled Error
type: object
description: >
Your API access has been disabled. Please contact us through live chat
or email [email protected] for
more information.
properties:
status:
type: string
description: >
The error status is an identifier for the type of error that
occurred.
enum:
- internal_server
- invalid_api_key
- missing_api_key
- rate_limit_exceeded
- under_maintenance
- not_found
- validation
- insufficient_credits
- invalid_body
- insufficient_plan
- api_access_disabled
example: api_access_disabled
pattern: ^api_access_disabled$
message:
type: string
description: >
A human-readable message describing the error. This message is
intended to be read by a developer and is
not suitable for display to an end user.
example: >
Your API access has been disabled. Please contact us through live
chat or email [email protected] for
more information.
example:
status: api_access_disabled
message: >
Your API access has been disabled. Please contact us through live chat
or email [email protected] for
more information.
ForbiddenError:
title: Forbidden Error
type: object
description: >
The forbidden error object is returned in the response body of any
request that results a `403 Forbidden` error.
oneOf:
- $ref: '#/components/schemas/InvalidApiKeyError'
- $ref: '#/components/schemas/ApiAccessDisabledError'
discriminator:
propertyName: status
mapping:
invalid_api_key: '#/components/schemas/InvalidApiKeyError'
api_access_disabled: '#/components/schemas/ApiAccessDisabledError'
SearchRequest:
title: Search Request
type: object
description: >
The search request object contains the search terms and options for a
search request.
properties:
id:
type: string
pattern: ^[a-zA-Z0-9]{32}$
description: |
The unique identifier for the search request.
example: 9J1VrsN0ku2E6xW8M5Xh3zylpfZgIcba
terms:
anyOf:
- type: array
items:
type: string
- type: 'null'
description: >
The terms searched for. If the search request was deleted, this
value will be null.
example:
- When to plant out broad beans?
- How to grow broad beans?
- When to harvest broad beans?
language:
anyOf:
- type: string
enum:
- af
- ar
- hy
- be
- bg
- ca
- zh-CN
- zh-TW
- hr
- cs
- da
- nl
- en
- eo
- et
- tl
- fi
- fr
- de
- el
- iw
- hi
- hu
- is
- id
- it
- ja
- ko
- lv
- lt
- 'no'
- fa
- pl
- pt
- ro
- ru
- sr
- sk
- sl
- es
- sw
- sv
- th
- tr
- uk
- vi
- type: 'null'
description: >
The language code used when performing a search. The language code
is a two-letter ISO 639-1 code. If the search
request was deleted, this value will be null.
example: en
region:
anyOf:
- type: string
enum:
- af
- al
- dz
- as
- ad
- ao
- ai
- aq
- ag
- ar
- am
- aw
- au
- at
- az
- bs
- bh
- bd
- bb
- by
- be
- bz
- bj
- bm
- bt
- bo
- ba
- bw
- bv
- br
- io
- bn
- bg
- bf
- bi
- kh
- cm
- ca
- cv
- ky
- cf
- td
- cl
- cn
- cx
- cc
- co
- km
- cg
- cd
- ck
- cr
- ci
- hr
- cu
- cy
- cz
- dk
- dj
- dm
- do
- ec
- eg
- sv
- gq
- er
- ee
- et
- fk
- fo
- fj
- fi
- fr
- gf
- pf
- tf
- ga
- gm
- ge
- de
- gh
- gi
- gr
- gl
- gd
- gp
- gu
- gt
- gn
- gw
- gy
- ht
- hm
- va
- hn
- hk
- hu
- is
- in
- id
- ir
- iq
- ie
- il
- it
- jm
- jp
- jo
- kz
- ke
- ki
- kp
- kr
- kw
- kg
- la
- lv
- lb
- ls
- lr
- ly
- li
- lt
- lu
- mo
- mk
- mg
- mw
- my
- mv
- ml
- mt
- mh
- mq
- mr
- mu
- yt
- mx
- fm
- md
- mc
- mn
- ms
- ma
- mz
- mm
- na
- nr
- np
- nl
- an
- nc
- nz
- ni
- ne
- ng
- nu
- nf
- mp
- 'no'
- om
- pk
- pw
- ps
- pa
- pg
- py
- pe
- ph
- pn
- pl
- pt
- pr
- qa
- re
- ro
- ru
- rw
- sh
- kn
- lc
- pm
- vc
- ws
- sm
- st
- sa
- sn
- rs
- sc
- sl
- sg
- sk
- si
- sb
- so
- za
- gs
- es
- lk
- sd
- sr
- sj
- sz
- se
- ch
- sy
- tw
- tj
- tz
- th
- tl
- tg
- tk
- to
- tt
- tn
- tr
- tm
- tc
- tv
- ug
- ua
- ae
- gb
- us
- um
- uy
- uz
- vu
- ve
- vn
- vg
- vi
- wf
- eh
- ye
- zm
- zw
- type: 'null'
description: >
The region code used when performing a search. The region code is a
two-letter ISO 3166-1 code. If the search
request was deleted, this value will be null.
example: us
latitude:
type: number
format: double
nullable: true
description: >
The latitude used when performing a search. If the search request
was deleted, this value will be null.
example: 51.5072
longitude:
type: number
format: double
nullable: true
description: >
The longitude used when performing a search. If the search request
was deleted, this value will be null.
example: 0.1276
status:
anyOf:
- type: string
enum:
- queuing
- pending
- running
- fetching
- error
- no_results
- success
- type: 'null'
description: >
The status of the search request. If the search request was deleted,
this value will be null.
example: success
deleted:
type: boolean
description: |
Whether the search request has been deleted.
example: false
depth:
anyOf:
- type: integer
format: int32
minimum: 2
maximum: 3
- type: 'null'
description: >
The depth of the search request. If the search request was deleted,
this value will be null.
example: 2
cached:
type: boolean
description: >
Whether the search request was fetched from the cache. This can be
overridden using the `fresh` parameter when
performing a search. If the search request was deleted, this value
will be null.
example: true
nullable: true
created_at:
type: string
format: date-time
description: |
The date and time at which the search request was created.
example: '2023-01-01T00:00:00Z'
updated_at:
type: string
format: date-time
description: |
The date and time at which the search request was last updated.
example: '2023-01-01T00:00:10Z'
cached_at:
anyOf:
- type: string
format: date-time
- type: 'null'
description: >
The date and time at which the search request was cached at. If the
search request wasn't fetched from the cache,
or the request has been deleted, this value will be null.
example: '2022-12-31T00:00:00Z'
example:
id: 9J1VrsN0ku2E6xW8M5Xh3zylpfZgIcba
terms:
- When to plant out broad beans?
- How to grow broad beans?
- When to harvest broad beans?
language: en
region: us
latitude: 51.5072
longitude: 0.1276
status: success
deleted: false
depth: 2
cached: true
created_at: '2023-01-01T00:00:00Z'
updated_at: '2023-01-01T00:00:10Z'
cached_at: '2022-12-31T00:00:00Z'
PaginatedSearchRequests:
title: Paginated Search Results
type: object
description: >
The paginated search results object is returned in the response body of
a successful request for previous search
requests.
properties:
total:
type: integer
format: int64
description: |
The total number of search requests.