github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/fixtures/codegen/instagram.yml (about) 1 swagger: '2.0' 2 info: 3 version: v1 4 title: Instagram API 5 description: > 6 The first version of the Instagram API is an exciting step forward towards 7 8 making it easier for users to have open access to their data. We created it 9 10 so that you can surface the amazing content Instagram users share every 11 12 second, in fun and innovative ways. 13 14 15 16 Build something great! 17 18 19 20 Once you've 21 22 [registered your client](http://instagram.com/developer/register/) it's easy 23 24 to start requesting data from Instagram. 25 26 27 28 All endpoints are only accessible via https and are located at 29 30 `api.instagram.com`. For instance: you can grab the most popular photos at 31 32 the moment by accessing the following URL with your client ID 33 34 (replace CLIENT-ID with your own): 35 36 ``` 37 38 https://api.instagram.com/v1/media/popular?client_id=CLIENT-ID 39 40 ``` 41 42 You're best off using an access_token for the authenticated user for each 43 44 endpoint, though many endpoints don't require it. 45 46 In some cases an access_token will give you more access to information, and 47 48 in all cases, it means that you are operating under a per-access_token limit 49 50 vs. the same limit for your single client_id. 51 52 53 54 55 56 ## Limits 57 58 Be nice. If you're sending too many requests too quickly, we'll send back a 59 60 `503` error code (server unavailable). 61 62 You are limited to 5000 requests per hour per `access_token` or `client_id` 63 64 overall. Practically, this means you should (when possible) authenticate 65 66 users so that limits are well outside the reach of a given user. 67 68 69 70 ## Deleting Objects 71 72 We do our best to have all our URLs be 73 74 [RESTful](http://en.wikipedia.org/wiki/Representational_state_transfer). 75 76 Every endpoint (URL) may support one of four different http verbs. GET 77 78 requests fetch information about an object, POST requests create objects, 79 80 PUT requests update objects, and finally DELETE requests will delete 81 82 objects. 83 84 85 86 Since many old browsers don't support PUT or DELETE, we've made it easy to 87 88 fake PUTs and DELETEs. All you have to do is do a POST with _method=PUT or 89 90 _method=DELETE as a parameter and we will treat it as if you used PUT or 91 92 DELETE respectively. 93 94 95 96 ## Structure 97 98 99 100 ### The Envelope 101 102 Every response is contained by an envelope. That is, each response has a 103 104 predictable set of keys with which you can expect to interact: 105 106 ```json 107 108 { 109 110 "meta": { 111 112 "code": 200 113 114 }, 115 116 "data": { 117 118 ... 119 120 }, 121 122 "pagination": { 123 124 "next_url": "...", 125 126 "next_max_id": "13872296" 127 128 } 129 130 } 131 132 ``` 133 134 135 136 #### META 137 138 The meta key is used to communicate extra information about the response to 139 140 the developer. If all goes well, you'll only ever see a code key with value 141 142 200. However, sometimes things go wrong, and in that case you might see a 143 144 response like: 145 146 ```json 147 148 { 149 150 "meta": { 151 152 "error_type": "OAuthException", 153 154 "code": 400, 155 156 "error_message": "..." 157 158 } 159 160 } 161 162 ``` 163 164 165 166 #### DATA 167 168 The data key is the meat of the response. It may be a list or dictionary, 169 170 but either way this is where you'll find the data you requested. 171 172 #### PAGINATION 173 174 Sometimes you just can't get enough. For this reason, we've provided a 175 176 convenient way to access more data in any request for sequential data. 177 178 Simply call the url in the next_url parameter and we'll respond with the 179 180 next set of data. 181 182 ```json 183 184 { 185 186 ... 187 188 "pagination": { 189 190 "next_url": 191 "https://api.instagram.com/v1/tags/puppy/media/recent?access_token=fb2e77d.47a0479900504cb3ab4a1f626d174d2d&max_id=13872296", 192 193 "next_max_id": "13872296" 194 195 } 196 197 } 198 199 ``` 200 201 On views where pagination is present, we also support the "count" parameter. 202 203 Simply set this to the number of items you'd like to receive. Note that the 204 205 default values should be fine for most applications - but if you decide to 206 207 increase this number there is a maximum value defined on each endpoint. 208 209 210 211 ### JSONP 212 213 If you're writing an AJAX application, and you'd like to wrap our response 214 215 with a callback, all you have to do is specify a callback parameter with 216 217 any API call: 218 219 ``` 220 221 https://api.instagram.com/v1/tags/coffee/media/recent?access_token=fb2e77d.47a0479900504cb3ab4a1f626d174d2d&callback=callbackFunction 222 223 ``` 224 225 Would respond with: 226 227 ```js 228 229 callbackFunction({ 230 231 ... 232 233 }); 234 235 ``` 236 termsOfService: 'http://instagram.com/about/legal/terms/api' 237 host: api.instagram.com 238 basePath: /v1 239 schemes: 240 - https 241 produces: 242 - application/json 243 consumes: 244 - application/json 245 tags: 246 - name: Users 247 - name: Relationships 248 description: | 249 Relationships are expressed using the following terms: 250 251 **outgoing_status**: Your relationship to the user. Can be "follows", 252 "requested", "none". 253 **incoming_status**: A user's relationship to you. Can be "followed_by", 254 "requested_by", "blocked_by_you", "none". 255 - name: Media 256 description: > 257 At this time, uploading via the API is not possible. We made a conscious 258 259 choice not to add this for the following reasons: 260 261 262 263 * Instagram is about your life on the go – we hope to encourage photos 264 265 from within the app. 266 267 * We want to fight spam & low quality photos. Once we allow uploading 268 269 from other sources, it's harder to control what comes into the Instagram 270 271 ecosystem. All this being said, we're working on ways to ensure users 272 273 have a consistent and high-quality experience on our platform. 274 - name: Commnts 275 - name: Likes 276 - name: Tags 277 - name: Location 278 - name: Subscribtions 279 securityDefinitions: 280 oauth: 281 type: oauth2 282 flow: implicit 283 authorizationUrl: 'https://instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token' 284 scopes: 285 basic: | 286 to read any and all data related to a user (e.g. following/followed-by 287 lists, photos, etc.) (granted by default) 288 comments: to create or delete comments on a user’s behalf 289 relationships: to follow and unfollow users on a user’s behalf 290 likes: to like and unlike items on a user’s behalf 291 key: 292 type: apiKey 293 in: query 294 name: access_token 295 security: 296 - oauth: 297 - basic 298 - comments 299 - relationships 300 - likes 301 - key: [] 302 parameters: 303 user-id: 304 name: user-id 305 in: path 306 description: The user identifier number 307 type: number 308 required: true 309 tag-name: 310 name: tag-name 311 in: path 312 description: Tag name 313 type: string 314 required: true 315 paths: 316 '/users/{user-id}': 317 parameters: 318 - $ref: '#/parameters/user-id' 319 get: 320 security: 321 - key: [] 322 - oauth: 323 - basic 324 tags: 325 - Users 326 description: Get basic information about a user. 327 responses: 328 '200': 329 description: The user object 330 schema: 331 type: object 332 properties: 333 data: 334 $ref: '#/definitions/User' 335 /users/self/feed: 336 get: 337 tags: 338 - Users 339 description: "See the authenticated user's feed." 340 parameters: 341 - name: count 342 in: query 343 description: Count of media to return. 344 type: integer 345 - name: max_id 346 in: query 347 description: Return media earlier than this max_id.s 348 type: integer 349 - name: min_id 350 in: query 351 description: Return media later than this min_id. 352 type: integer 353 responses: 354 '200': 355 description: OK 356 schema: 357 type: object 358 properties: 359 data: 360 type: array 361 items: 362 $ref: '#/definitions/Media' 363 '/users/{user-id}/media/recent': 364 parameters: 365 - $ref: '#/parameters/user-id' 366 get: 367 tags: 368 - Users 369 responses: 370 '200': 371 description: > 372 Get the most recent media published by a user. To get the most 373 recent 374 375 media published by the owner of the access token, you can use `self` 376 377 instead of the `user-id`. 378 schema: 379 type: object 380 properties: 381 data: 382 type: array 383 items: 384 $ref: '#/definitions/Media' 385 parameters: 386 - name: count 387 in: query 388 description: Count of media to return. 389 type: integer 390 - name: max_timestamp 391 in: query 392 description: Return media before this UNIX timestamp. 393 type: integer 394 - name: min_timestamp 395 in: query 396 description: Return media after this UNIX timestamp. 397 type: integer 398 - name: min_id 399 in: query 400 description: Return media later than this min_id. 401 type: string 402 - name: max_id 403 in: query 404 description: Return media earlier than this max_id. 405 type: string 406 /users/self/media/liked: 407 get: 408 tags: 409 - Users 410 description: | 411 See the list of media liked by the authenticated user. 412 Private media is returned as long as the authenticated user 413 has permissionto view that media. Liked media lists are only 414 available for the currently authenticated user. 415 responses: 416 '200': 417 description: OK 418 schema: 419 type: object 420 properties: 421 data: 422 type: array 423 items: 424 $ref: '#/definitions/Media' 425 parameters: 426 - name: count 427 in: query 428 description: Count of media to return. 429 type: integer 430 - name: max_like_id 431 in: query 432 description: Return media liked before this id. 433 type: integer 434 /users/search: 435 get: 436 tags: 437 - Users 438 description: Search for a user by name. 439 parameters: 440 - name: q 441 in: query 442 description: A query string 443 type: string 444 required: true 445 - name: count 446 in: query 447 description: Number of users to return. 448 type: string 449 responses: 450 '200': 451 description: OK 452 schema: 453 type: object 454 properties: 455 data: 456 type: array 457 items: 458 $ref: '#/definitions/MiniProfile' 459 '/users/{user-id}/follows': 460 parameters: 461 - $ref: '#/parameters/user-id' 462 get: 463 tags: 464 - Relationships 465 description: Get the list of users this user follows. 466 responses: 467 '200': 468 description: OK 469 schema: 470 properties: 471 data: 472 type: array 473 items: 474 $ref: '#/definitions/MiniProfile' 475 '/users/{user-id}/followed-by': 476 parameters: 477 - $ref: '#/parameters/user-id' 478 get: 479 tags: 480 - Relationships 481 description: Get the list of users this user is followed by. 482 responses: 483 '200': 484 description: OK 485 schema: 486 properties: 487 data: 488 type: array 489 items: 490 $ref: '#/definitions/MiniProfile' 491 /users/self/requested-by: 492 get: 493 tags: 494 - Relationships 495 description: | 496 List the users who have requested this user's permission to follow. 497 responses: 498 '200': 499 description: OK 500 schema: 501 properties: 502 meta: 503 properties: 504 code: 505 type: integer 506 data: 507 type: array 508 items: 509 $ref: '#/definitions/MiniProfile' 510 '/users/{user-id}/relationship': 511 parameters: 512 - $ref: '#/parameters/user-id' 513 post: 514 tags: 515 - Relationships 516 description: | 517 Modify the relationship between the current user and thetarget user. 518 security: 519 - oauth: 520 - relationships 521 parameters: 522 - name: action 523 in: body 524 description: One of follow/unfollow/block/unblock/approve/ignore. 525 schema: 526 type: string 527 enum: 528 - follow 529 - unfollow 530 - block 531 - unblock 532 - approve 533 responses: 534 '200': 535 description: OK 536 schema: 537 properties: 538 data: 539 type: array 540 items: 541 $ref: '#/definitions/MiniProfile' 542 '/media/{media-id}': 543 parameters: 544 - name: media-id 545 in: path 546 description: The media ID 547 type: integer 548 required: true 549 get: 550 tags: 551 - Media 552 description: | 553 Get information about a media object. 554 The returned type key will allow you to differentiate between `image` 555 and `video` media. 556 557 Note: if you authenticate with an OAuth Token, you will receive the 558 `user_has_liked` key which quickly tells you whether the current user 559 has liked this media item. 560 responses: 561 '200': 562 description: OK 563 schema: 564 $ref: '#/definitions/Media' 565 '/media1/{shortcode}': 566 parameters: 567 - name: shortcode 568 in: path 569 description: The media shortcode 570 type: string 571 required: true 572 get: 573 tags: 574 - Media 575 description: | 576 This endpoint returns the same response as **GET** `/media/media-id`. 577 578 A media object's shortcode can be found in its shortlink URL. 579 An example shortlink is `http://instagram.com/p/D/` 580 Its corresponding shortcode is D. 581 responses: 582 '200': 583 description: OK 584 schema: 585 $ref: '#/definitions/Media' 586 /media/search: 587 get: 588 tags: 589 - Media 590 description: | 591 Search for media in a given area. The default time span is set to 5 592 days. The time span must not exceed 7 days. Defaults time stamps cover 593 the last 5 days. Can return mix of image and video types. 594 parameters: 595 - name: LAT 596 description: | 597 Latitude of the center search coordinate. If used, lng is required. 598 type: number 599 in: query 600 - name: MIN_TIMESTAMP 601 description: | 602 A unix timestamp. All media returned will be taken later than 603 this timestamp. 604 type: integer 605 in: query 606 - name: LNG 607 description: > 608 Longitude of the center search coordinate. If used, lat is required. 609 type: number 610 in: query 611 - name: MAX_TIMESTAMP 612 description: > 613 A unix timestamp. All media returned will be taken earlier than this 614 615 timestamp. 616 type: integer 617 in: query 618 - name: DISTANCE 619 description: 'Default is 1km (distance=1000), max distance is 5km.' 620 type: integer 621 maximum: 5000 622 default: 1000 623 in: query 624 responses: 625 '200': 626 description: OK 627 schema: 628 type: object 629 description: List of all media with added `distance` property 630 properties: 631 data: 632 type: array 633 items: 634 allOf: 635 - $ref: '#/definitions/Media' 636 - properties: 637 distance: 638 type: number 639 /media/popular: 640 get: 641 tags: 642 - Media 643 description: | 644 Get a list of what media is most popular at the moment. 645 Can return mix of image and video types. 646 responses: 647 '200': 648 description: OK 649 schema: 650 type: object 651 properties: 652 data: 653 type: array 654 items: 655 $ref: '#/definitions/Media' 656 '/media/{media-id}/comments': 657 parameters: 658 - name: media-id 659 in: path 660 description: Media ID 661 type: integer 662 required: true 663 get: 664 tags: 665 - Comments 666 description: | 667 Get a list of recent comments on a media object. 668 responses: 669 '200': 670 description: OK 671 schema: 672 properties: 673 meta: 674 properties: 675 code: 676 type: number 677 data: 678 type: array 679 items: 680 $ref: '#/definitions/Comment' 681 post: 682 tags: 683 - Comments 684 - Media 685 description: | 686 Create a comment on a media object with the following rules: 687 688 * The total length of the comment cannot exceed 300 characters. 689 * The comment cannot contain more than 4 hashtags. 690 * The comment cannot contain more than 1 URL. 691 * The comment cannot consist of all capital letters. 692 security: 693 - oauth: 694 - comments 695 parameters: 696 - name: TEXT 697 description: | 698 Text to post as a comment on the media object as specified in 699 media-id. 700 in: body 701 schema: 702 type: number 703 responses: 704 '200': 705 description: OK 706 schema: 707 type: object 708 properties: 709 meta: 710 properties: 711 code: 712 type: number 713 data: 714 type: object 715 delete: 716 tags: 717 - Comments 718 description: | 719 Remove a comment either on the authenticated user's media object or 720 authored by the authenticated user. 721 responses: 722 '200': 723 description: OK 724 schema: 725 type: object 726 properties: 727 meta: 728 properties: 729 code: 730 type: number 731 data: 732 type: object 733 '/media/{media-id}/likes': 734 parameters: 735 - name: media-id 736 in: path 737 description: Media ID 738 type: integer 739 required: true 740 get: 741 tags: 742 - Likes 743 - Media 744 description: | 745 Get a list of users who have liked this media. 746 responses: 747 '200': 748 description: OK 749 schema: 750 properties: 751 meta: 752 properties: 753 code: 754 type: number 755 data: 756 type: array 757 items: 758 $ref: '#/definitions/Like' 759 post: 760 tags: 761 - Likes 762 description: Set a like on this media by the currently authenticated user. 763 security: 764 - oauth: 765 - comments 766 responses: 767 '200': 768 description: OK 769 schema: 770 type: object 771 properties: 772 meta: 773 properties: 774 code: 775 type: number 776 data: 777 type: object 778 delete: 779 tags: 780 - Likes 781 description: | 782 Remove a like on this media by the currently authenticated user. 783 responses: 784 '200': 785 description: OK 786 schema: 787 type: object 788 properties: 789 meta: 790 properties: 791 code: 792 type: number 793 data: 794 type: object 795 '/tags/{tag-name}': 796 parameters: 797 - $ref: '#/parameters/tag-name' 798 get: 799 tags: 800 - Tags 801 description: Get information about a tag object. 802 responses: 803 '200': 804 description: OK 805 schema: 806 $ref: '#/definitions/Tag' 807 '/tags/{tag-name}/media/recent': 808 parameters: 809 - $ref: '#/parameters/tag-name' 810 get: 811 tags: 812 - Tags 813 description: | 814 Get a list of recently tagged media. Use the `max_tag_id` and 815 `min_tag_id` parameters in the pagination response to paginate through 816 these objects. 817 responses: 818 '200': 819 description: OK 820 schema: 821 properties: 822 data: 823 type: array 824 items: 825 $ref: '#/definitions/Tag' 826 /tags/search: 827 get: 828 tags: 829 - Tags 830 parameters: 831 - name: q 832 description: | 833 A valid tag name without a leading #. (eg. snowy, nofilter) 834 in: query 835 type: string 836 responses: 837 '200': 838 description: OK 839 schema: 840 type: object 841 properties: 842 meta: 843 properties: 844 code: 845 type: integer 846 data: 847 type: array 848 items: 849 $ref: '#/definitions/Tag' 850 '/locations/{location-id}': 851 parameters: 852 - name: location-id 853 description: Location ID 854 in: path 855 type: integer 856 required: true 857 get: 858 tags: 859 - Location 860 description: Get information about a location. 861 responses: 862 '200': 863 description: OK 864 schema: 865 type: object 866 properties: 867 data: 868 $ref: '#/definitions/Location' 869 '/locations/{location-id}/media/recent': 870 parameters: 871 - name: location-id 872 description: Location ID 873 in: path 874 type: integer 875 required: true 876 get: 877 tags: 878 - Location 879 - Media 880 description: Get a list of recent media objects from a given location. 881 parameters: 882 - name: max_timestamp 883 in: query 884 description: Return media before this UNIX timestamp. 885 type: integer 886 - name: min_timestamp 887 in: query 888 description: Return media after this UNIX timestamp. 889 type: integer 890 - name: min_id 891 in: query 892 description: Return media later than this min_id. 893 type: string 894 - name: max_id 895 in: query 896 description: Return media earlier than this max_id. 897 type: string 898 responses: 899 '200': 900 description: OK 901 schema: 902 type: object 903 properties: 904 data: 905 type: array 906 items: 907 $ref: '#/definitions/Media' 908 /locations/search: 909 get: 910 tags: 911 - Location 912 description: Search for a location by geographic coordinate. 913 parameters: 914 - name: distance 915 in: query 916 description: 'Default is 1000m (distance=1000), max distance is 5000.' 917 type: integer 918 - name: facebook_places_id 919 in: query 920 description: | 921 Returns a location mapped off of a Facebook places id. If used, a 922 Foursquare id and lat, lng are not required. 923 type: integer 924 - name: foursquare_id 925 in: query 926 description: > 927 returns a location mapped off of a foursquare v1 api location id. 928 929 If used, you are not required to use lat and lng. Note that this 930 931 method is deprecated; you should use the new foursquare IDs with V2 932 933 of their API. 934 type: integer 935 - name: lat 936 in: query 937 description: | 938 atitude of the center search coordinate. If used, lng is required. 939 type: number 940 - name: lng 941 in: query 942 description: | 943 ongitude of the center search coordinate. If used, lat is required. 944 type: number 945 - name: foursquare_v2_id 946 in: query 947 description: > 948 Returns a location mapped off of a foursquare v2 api location id. If 949 950 used, you are not required to use lat and lng. 951 type: integer 952 responses: 953 '200': 954 description: OK 955 schema: 956 type: object 957 properties: 958 data: 959 type: array 960 items: 961 $ref: '#/definitions/Location' 962 '/geographies/{geo-id}/media/recent': 963 parameters: 964 - name: geo-id 965 in: path 966 description: Geolocation ID 967 type: integer 968 required: true 969 get: 970 description: | 971 Get recent media from a geography subscription that you created. 972 **Note**: You can only access Geographies that were explicitly created 973 by your OAuth client. Check the Geography Subscriptions section of the 974 [real-time updates page](https://instagram.com/developer/realtime/). 975 When you create a subscription to some geography 976 that you define, you will be returned a unique geo-id that can be used 977 in this query. To backfill photos from the location covered by this 978 geography, use the [media search endpoint 979 ](https://instagram.com/developer/endpoints/media/). 980 parameters: 981 - name: count 982 in: query 983 description: Max number of media to return. 984 type: integer 985 - name: min_id 986 in: query 987 description: Return media before this `min_id`. 988 type: integer 989 responses: 990 '200': 991 description: OK 992 definitions: 993 User: 994 type: object 995 properties: 996 id: 997 type: integer 998 username: 999 type: string 1000 full_name: 1001 type: string 1002 profile_picture: 1003 type: string 1004 bio: 1005 type: string 1006 website: 1007 type: string 1008 counts: 1009 type: object 1010 properties: 1011 media: 1012 type: integer 1013 follows: 1014 type: integer 1015 follwed_by: 1016 type: integer 1017 Media: 1018 type: object 1019 properties: 1020 created_time: 1021 description: Epoc time (ms) 1022 type: integer 1023 type: 1024 type: string 1025 filter: 1026 type: string 1027 tags: 1028 type: array 1029 items: 1030 $ref: '#/definitions/Tag' 1031 id: 1032 type: integer 1033 user: 1034 $ref: '#/definitions/MiniProfile' 1035 users_in_photo: 1036 type: array 1037 items: 1038 $ref: '#/definitions/MiniProfile' 1039 location: 1040 $ref: '#/definitions/Location' 1041 'comments:': 1042 type: object 1043 properties: 1044 count: 1045 type: integer 1046 data: 1047 type: array 1048 items: 1049 $ref: '#/definitions/Comment' 1050 likes: 1051 type: object 1052 properties: 1053 count: 1054 type: integer 1055 data: 1056 type: array 1057 items: 1058 $ref: '#/definitions/MiniProfile' 1059 images: 1060 properties: 1061 low_resolution: 1062 $ref: '#/definitions/Image' 1063 thumbnail: 1064 $ref: '#/definitions/Image' 1065 standard_resolution: 1066 $ref: '#/definitions/Image' 1067 videos: 1068 properties: 1069 low_resolution: 1070 $ref: '#/definitions/Image' 1071 standard_resolution: 1072 $ref: '#/definitions/Image' 1073 Location: 1074 type: object 1075 properties: 1076 id: 1077 type: string 1078 name: 1079 type: string 1080 latitude: 1081 type: number 1082 longitude: 1083 type: number 1084 Comment: 1085 type: object 1086 properties: 1087 id: 1088 type: string 1089 created_time: 1090 type: string 1091 text: 1092 type: string 1093 from: 1094 $ref: '#/definitions/MiniProfile' 1095 Like: 1096 type: object 1097 properties: 1098 user_name: 1099 type: string 1100 first_name: 1101 type: string 1102 last_name: 1103 type: string 1104 type: 1105 type: string 1106 id: 1107 type: string 1108 Tag: 1109 type: object 1110 properties: 1111 media_count: 1112 type: integer 1113 name: 1114 type: string 1115 Image: 1116 type: object 1117 properties: 1118 width: 1119 type: integer 1120 height: 1121 type: integer 1122 url: 1123 type: string 1124 MiniProfile: 1125 type: object 1126 description: A shorter version of User for likes array 1127 properties: 1128 user_name: 1129 type: string 1130 full_name: 1131 type: string 1132 id: 1133 type: integer 1134 profile_picture: 1135 type: string