forked from matthewhuie/foursquare-dart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfoursquare-openapi.yaml
1641 lines (1553 loc) · 49 KB
/
foursquare-openapi.yaml
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.0
info:
title: Foursquare Places API
description: >-
## API Status
Status for the API can be found at
[status.foursquare.com](http://status.foursquare.com)!
## Getting Started
Using Foursquare's Places API, you can do just about anything you can do on
foursquare.com, while using your programming language of choice. The
Foursquare API is a RESTful API based on HTTP requests and JSON responses.
This version of the API, version 2, uses OAuth 2.0. This means that all
requests will need to be encrypted and sent via HTTPS. It also means that
you need to register your application, even if you aren't allowing users to
login.
We highly encourage looking at the endpoints in the Popular Endpoints folder
first to evaluate if they suit your needs, before exploring the others.
version: 1.0.0
servers:
- url: 'https://api.foursquare.com'
tags:
- name: Popular Endpoints
- name: Venues
- name: Photos
- name: Tips
- name: Lists
- name: Venue Edits
description: >-
These endpoints make suggested changes directly to data that is publicly
accessible to our data consumers. Test and use these endpoints with
caution, and avoid editing data for popular venues or venues that you are
unfamiliar with.
If found or reported, misuse of these endpoints will lead to immediate
account restrictions and permanent account bans from future edits.
components:
schemas:
Checkin:
type: object
VenueCategory:
type: object
User:
type: object
properties:
id:
type: string
VenuePhoto:
type: object
FoursquareResponse:
type: object
Venue:
type: object
properties:
id:
type: string
paths:
/v2/venues/search:
get:
tags:
- Venues
operationId: "searchVenues"
summary: 'Search for Venues'
description: >-
Returns a list of venues near the current location, optionally matching
a search term.
Note that most of the fields returned inside a venue can be optional.
The user may create a venue that has no address, city, or state (the
venue is created instead at the lat/long specified). Your client should
handle these conditions safely. For more robust venue information
(photos/tips/etc.), please see our venue details endpoint.
#### Response Model: [Venues/Response
Fields](https://developer.foursquare.com/docs/api/venues/search)
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: ll
in: query
schema:
type: string
description: REQUIRED. Latitude and longitude of the user’s location
example: '40.7099,-73.9622'
- name: name
in: query
schema:
type: string
example: peter luger steakhouse
- name: intent
in: query
schema:
type: string
description: >-
Finds a venue that is the near-exact match for the given parameters.
This intent is primarily used when trying to harmonize an existing
place database with Foursquare’s and is highly sensitive to the
provided location. The result will take into account distance and
spelling variations. name and ll are the only required parameters
for this intent, but we also suggest sending phone, address, city,
state, zip, and twitter for better results. There’s no specified
format for these parameters—we do our best to normalize them and
drop them from the search if unsuccessful.
example: match
- name: phone
in: query
schema:
type: string
- name: address
in: query
schema:
type: string
- name: city
in: query
schema:
type: string
- name: state
in: query
schema:
type: string
- name: zip
in: query
schema:
type: string
- name: twitter
in: query
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Venue'
'/v2/venues/{venueId}':
get:
tags:
- Venues
summary: Suggest Completion
description: >-
Returns a list of mini-venues partially matching the search term, near
the location.
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: locale
in: query
schema:
type: string
description: >
Undocumented. Allows API consumers to pull relevant information (if
available) in the specified ISO 639-1 2-Letter Language Code. If
langauge information is not available, response will be returned in
English.
example: ja
- name: venueId
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Venue'
/v2/venues/categories:
get:
tags:
- Venues
operationId: 'getVenueCategories'
summary: Get Venue Categories
description: >-
Returns a hierarchical list of categories applied to venues. This list
is also available on our
[categories](https://developer.foursquare.com/docs/resources/categories)
page.
#### Response Model: [Categories/Response
Fields](https://developer.foursquare.com/docs/api/venues/categories)
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: locale
in: query
schema:
type: string
description: >
Undocumented. Allows API consumers to pull relevant information (if
available) in the specified ISO 639-1 2-Letter Language Code. If
langauge information is not available, response will be returned in
English. Supported locales can be found at
https://developer.foursquare.com/docs/api/configuration/internationalization
example: es
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/VenueCategory'
/v2/venues/explore:
get:
tags:
- Venues
summary: Get Venue Recommendations
description: >-
Recommended only if you require the user to log into their Foursquare
accounts for personalised recommendations. If not, consider "Search for
Venues (intent: browse)" for a list of recommendations.
Returns a list of recommended venues near the current location. For more
robust information about the venues themselves (photos/tips/etc.),
please see our venue details endpoint.
If authenticated, the method will personalize the ranking based on you
and your friends.
#### Response Model: [Venues/Response
Fields](https://developer.foursquare.com/docs/api/venues/explore)
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: ll
in: query
schema:
type: number
description: >-
REQUIRED unless near is provided. Latitude and longitude of the
user’s location.
example: '1.283644,103.860753'
- name: near
in: query
schema:
type: string
description: >-
REQUIRED unless ll is provided. A string naming a place in the
world. If the near string is not geocodable, returns a
failed_geocode error. Otherwise, searches within the bounds of the
geocode and adds a geocode object to the response.
example: marina bay singapore
- name: llAcc
in: query
schema:
type: number
description: 'Accuracy of latitude and longitude, in meters.'
example: '10000.0'
- name: alt
in: query
schema:
type: integer
description: 'Altitude of the user’s location, in meters.'
example: '0'
- name: altAcc
in: query
schema:
type: number
description: 'Accuracy of the user’s altitude, in meters.'
example: '10000.0'
- name: radius
in: query
schema:
type: integer
description: >-
Radius to search within, in meters. If radius is not specified, a
suggested radius will be used based on the density of venues in the
area. The maximum supported radius is currently 100,000 meters.
example: '250'
- name: section
in: query
schema:
type: string
description: >-
One of food, drinks, coffee, shops, arts, outdoors, sights,
trending, nextVenues (venues frequently visited after a given
venue), or topPicks (a mix of recommendations generated without a
query from the user). Choosing one of these limits results to venues
with the specified category or property.
example: food
- name: query
in: query
schema:
type: string
description: >-
A term to be searched against a venue’s tips, category, etc. The
query parameter has no effect when a section is specified.
example: steak
- name: limit
in: query
schema:
type: integer
description: |
Number of results to return, up to 50.
example: '10'
- name: offset
in: query
schema:
type: integer
description: 'Used to page through results, up to 50.'
example: '5'
- name: novelty
in: query
schema:
type: string
description: >-
Use only if you have user's Foursquare OAUTH token.
Pass new or old to limit results to places the acting user hasn’t
been or has been, respectively. Omitting this parameter returns a
mixture of old and new venues.
- name: friendVisits
in: query
schema:
type: string
description: >-
Use only if you have user's Foursquare OAUTH token.
Pass visited or notvisited to limit results to places the acting
user’s friends have or haven’t been, respectively. Omitting this
parameter returns a mixture of venues to which the user’s friends
have or haven’t been.
- name: time
in: query
schema:
type: string
description: >-
Pass any to retrieve results for any time of day. Omitting this
parameter returns results targeted to the current time of day.
example: any
- name: day
in: query
schema:
type: string
description: >-
Pass any to retrieve results for any day of the week. Omitting this
parameter returns results targeted to the current day of the week.
example: any
- name: lastVenue
in: query
schema:
type: string
description: >-
Use only if you have user's Foursquare OAUTH token.
A venue ID to use in combination with the intent=nextVenues
parameter, which returns venues users often visit after a given
venue. If intent=nextVenues is specified but lastVenue is not, the
user’s last check-in will be used if it is within 2 hours. If the
user has not checked in within the last 2 hours, no results will be
returned.
- name: intent
in: query
schema:
type: string
description: >-
Use only if you have user's Foursquare OAUTH token.
Used alongside the lastVenue parameter, and will tell you venues
that the Foursquare user will often visit after the given lastVenue.
example: nextVenue
- name: openNow
in: query
schema:
type: integer
description: >-
Boolean flag to only include venues that are open now. This prefers
official provider hours but falls back to popular check-in hours.
example: '1'
- name: sortByDistance
in: query
schema:
type: integer
description: Boolean flag to sort the results by distance instead of relevance.
example: '1'
- name: price
in: query
schema:
type: string
description: >-
Comma separated list of price points. Currently the valid range of
price points are [1,2,3,4], 1 being the least expensive, 4 being the
most expensive. For food venues, in the United States, 1 is < $10 an
entree, 2 is $10-$20 an entree, 3 is $20-$30 an entree, 4 is > $30
an entree.
example: '2,3'
- name: saved
in: query
schema:
type: integer
description: >-
Use only if you have user's Foursquare OAUTH token.
Boolean flag to only include venues that the user has saved on their
To-Do list or to another list.
example: '1'
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Venue'
'/v2/venues/{venueId}/select':
post:
tags:
- Venues
summary: Report Venue Selection
description: >+
Report the selection of a venue as the result of a search, explore, or
suggestcompletion request.
Venue selections or ‘pingbacks’ are used exclusively as inputs for
training our underlying venue search model; this helps us improve
accuracy at the places you and your users care about.
No personally identifiable information is collected at any point.
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: requestId
in: query
schema:
type: string
description: >-
REQUIRED. The request ID returned in the search response leading to
the venue selection.
example: '{{requestId_select}}'
- name: type
in: query
schema:
type: string
description: >-
REQUIRED. The type of selection the user has made. One of
currentLocation, destination, or save.
example: currentLocation
- name: visitSignature
in: query
schema:
type: string
description: >-
REQUIRED. The HMAC hex digest of the message "APP_USER_ID, VENUE_ID,
CURRENT_YYYYMMDD". This allows us to distinguish between three
selections at a venue by a single user vs. by three distinct users
while preserving user privacy.
example: '{{visitSignature_select}}'
- name: venueId
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json: {}
'/v2/venues/{VENUE_ID}/photos':
get:
tags:
- Venues
summary: Get a Venue's Photos
operationId: getVenuePhotos
description: >-
Returns photos for a specific venue. To assemble a photo URL, combine
the response’s prefix + size + suffix. Ex:
https://igx.4sqi.net/img/general/300x500/5163668_xXFcZo7sU8aa1ZMhiQ2kIP7NllD48m7qsSwr1mJnFj4.jpg
size can be one of the following, where XX or YY is one of 36, 100, 300,
or 500.
XXxYY
original: the original photo’s size
capXX: cap the photo with a width or height of XX. (whichever is
larger). Scales the other, smaller dimension proportionally
widthXX: forces the width to be XX and scales the height proportionally
heightYY: forces the height to be YY and scales the width proportionally
#### Response Model: [Photos/Response
Fields](https://developer.foursquare.com/docs/api/venues/photos)
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: group
in: query
schema:
type: string
example: venue
- name: limit
in: query
schema:
type: integer
example: '10'
- name: VENUE_ID
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json:
schema:
allOf:
- type: object
properties:
response:
type: object
properties:
photos:
type: object
properties:
count:
type: integer
items:
type: array
items:
$ref: '#/components/schemas/VenuePhoto'
- $ref: '#/components/schemas/FoursquareResponse'
/:
get:
tags:
- Venues
summary: Show Venue Photo
operationId: showVenuePhoto
description: >-
To assemble a photo URL, combine the response’s prefix + size + suffix.
Ex:
https://igx.4sqi.net/img/general/300x500/5163668_xXFcZo7sU8aa1ZMhiQ2kIP7NllD48m7qsSwr1mJnFj4.jpg
size can be one of the following, where XX or YY is one of 36, 100, 300,
or 500.
XXxYY
original: the original photo’s size
capXX: cap the photo with a width or height of XX. (whichever is
larger). Scales the other, smaller dimension proportionally
widthXX: forces the width to be XX and scales the height proportionally
heightYY: forces the height to be YY and scales the width proportionally
responses:
'200':
description: Successful response
content:
application/image: {}
'/v2/venues/{VENUE_ID}/tips':
get:
tags:
- Venues
summary: Get a Venue's Tips
description: >-
Returns tips for a venue.
#### Response Model: [Tips/Response
Fields](https://developer.foursquare.com/docs/api/venues/tips)
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: sort
in: query
schema:
type: string
description: 'One of friends, recent, or popular.'
example: popular
- name: limit
in: query
schema:
type: integer
description: 'Number of results to return, up to 500.'
example: '10'
- name: offset
in: query
schema:
type: string
description: Used to page through results.
- name: VENUE_ID
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json: {}
'/v2/venues/{VENUE_ID}/hours':
get:
tags:
- Venues
summary: Get a Venue's Hours
description: >-
Returns hours for a venue.
#### Response Model: [Hours/Response
Fields](https://developer.foursquare.com/docs/api/venues/hours)
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: VENUE_ID
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json: {}
'/v2/venues/{VENUE_ID}/menu':
get:
tags:
- Venues
summary: Get a Venue's Menu
description: >-
Returns menu information for a venue.
#### Response Model: [Menu/Response
Fields](https://developer.foursquare.com/docs/api/venues/menu)
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: VENUE_ID
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json: {}
'/v2/venues/{VENUE_ID}/links':
get:
tags:
- Venues
summary: Get a Venue's Links
description: >-
Returns URLs or identifiers from third parties that have been applied to
this venue.
Used in conjunction with the "Search for Venues" endpoint to obtain
relevant sources of information.
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: VENUE_ID
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json: {}
/v2/venues/trending:
get:
tags:
- Venues
summary: Get Trending Venues
description: >-
Returns a list of venues near the current location with the most people
currently checked in.
Results returned are trending venues based on real-local-time.
For more robust information about the venues themselves
(photos/tips/etc.), please see our venue details endpoint.
#### Response Model: [Trending Venues/Response
Fields](https://developer.foursquare.com/docs/api/venues/trending)
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: ll
in: query
schema:
type: number
description: >-
REQUIRED unless near is provided. Latitude and longitude of the
desired location.
example: '40.7099,-73.9622'
- name: near
in: query
schema:
type: string
description: >-
REQUIRED unless ll is provided. A string naming a place in the
world. If the near string is not geocodable, returns a
failed_geocode error. Otherwise, searches within the bounds of the
geocode and adds a geocode object to the response.
example: Brooklyn New York
- name: limit
in: query
schema:
type: integer
description: 'Number of results to return, up to 50.'
example: '10'
- name: radius
in: query
schema:
type: integer
description: 'Radius in meters, up to approximately 2000 meters.'
example: '10000'
responses:
'200':
description: Successful response
content:
application/json: {}
'/v2/venues/{VENUE_ID}/likes':
get:
tags:
- Venues
summary: Get Users Who Liked a Venue
description: >-
Returns friends and a total count of users who have liked this venue.
Count for friends will only be applicable when you provide a Foursquare
user's OAUTH2 token.
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: oauth_token
in: query
schema:
type: string
example: '{{oauth_token}}'
- name: VENUE_ID
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json: {}
'/v2/venues/{VENUE_ID}/similar':
get:
tags:
- Venues
summary: Get Similar Venues
description: >-
Returns a list of venues similar and near to the specified venue. For
more robust information about the venues themselves (photos/tips/etc.),
please see our venue details endpoint.
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string
example: '{{v}}'
- name: VENUE_ID
in: path
schema:
type: string
required: true
responses:
'200':
description: Successful response
content:
application/json: {}
'/v2/venues/{VENUE_ID}/nextvenues':
get:
tags:
- Venues
summary: Get Next Venues
description: >+
Returns venues that people often check in to after the current venue. Up
to 5 venues are returned in each query, and results are sorted by how
many people have visited that venue after the current one. For more
robust information about the venues themselves (photos/tips/etc.),
please see our venue details endpoint.
parameters:
- name: client_id
in: query
schema:
type: string
example: '{{client_id}}'
- name: client_secret
in: query
schema:
type: string
example: '{{client_secret}}'
- name: v
in: query
schema:
type: string