UNPKG

openapi-directory

Version:

Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS

1 lines 11.2 kB
{"openapi":"3.0.0","info":{"contact":{"x-twitter":"GlobalWineScore"},"description":"\n\nThe GlobalWineScore API is designed as a RESTful API, providing several resources and methods depending on your usage plan.\n\nFor further information please refer to <a href=\"https://www.globalwinescore.com/plans\" target=\"_blank\">our plans</a>.\n\n# Authentication\nThe API uses token-based authentication.\nIn order to authenticate your requests, you need to include a specific header in each of your requests:\n\n```\nAuthorization: Token {YOUR-API-TOKEN}\n```\n\nIf you don't have a token yet, you need to apply for one [here](https://www.globalwinescore.com/api/) or drop us an email at <a href=\"mailto:api@globalwinescore.com\">api@globalwinescore.com</a>\n\nYour personal token can be found under the <a href=\"https://www.globalwinescore.com/account/api/\" target=\"_blank\">My account > API</a> section of the GlobalWineScore website\n\n# Format\nThe API provides several rendering formats which you can control using the `Accept` header or `format` query parameter.\n\n- JSON (default): no header or `Accept: application/json`\n- XML: `Accept: application/xml`\n\n# Error handling\n\nWhether a request succeeded is indicated by the HTTP status code. A 2xx status code indicates success, whereas a 4xx status code indicates failure.\n\nWhen a request fails, the response body is still JSON, but always contains a `detail` field with a description of the error, which you can inspect for debugging.\n\nFor example, trying to access the API without proper authentication will return code 403 along with the message:\n\n`{\"detail\": \"Authentication credentials were not provided.\"}`\n\nFound a bug ? send us an email at <a href=\"mailto:api@globalwinescore.com\">api@globalwinescore.com</a>\n\n# Ordering\n\nAt the moment, GlobalWineScores may be sorted by `date` and `score`. Use \"-\"\nto sort in descending order.\n\n# Continuous synchronization\n\nIf you need to synchronize your database with our API, you can query our API using `?ordering=-date` to get the newest scores first, which means you won't have to crawl the whole catalog every time :-)\n\n# Quick search interface\nIf you need to search our catalog (e.g. to align it with yours), we're providing you with a handy interface accessible here: <a href=\"https://api.globalwinescore.com/search/\" target=\"_blank\">https://api.globalwinescore.com/search/</a>\n\nYou need to be logged in (email/password) to access this page, but other than that you can share it with anyone in your team and start searching right away !\n\n# Resources\n\nThe details about available endpoints can be found below.\nYou can click on each endpoint to find information about their parameters.\n","title":"GlobalWineScore","version":"8234aab51481d37a30757d925b7f4221a659427e","x-apisguru-categories":["open_data"],"x-logo":{"url":"https://twitter.com/GlobalWineScore/profile_image?size=original"},"x-origin":[{"format":"swagger","url":"https://globalwinescore.docs.apiary.io/api-description-document","version":"2.0"}],"x-providerName":"globalwinescore.com"},"security":[{"TokenAuthentication":[]}],"paths":{"/globalwinescores/":{"get":{"description":"Returns all available GWS","operationId":"listHistoricalGWS","parameters":[{"description":"","in":"header","name":"Authorization","example":"Token <YOUR-API-TOKEN>","schema":{"type":"string"}},{"description":"The exact `id` of the wine. Can be used multiple times (e.g `?wine_id=114959&wine_id=114952`) <br/> If you need to find the `wine_id` for your wines, use our <a href=\"https://api.globalwinescore.com/search/\" target=\"_blank\">search page</a>\n","in":"query","name":"wine_id","example":[114959,114952],"explode":true,"schema":{"type":"array","items":{"type":"integer"}}},{"description":"The vintage you want to search against.","in":"query","name":"vintage","example":"2000","schema":{"type":"string"}},{"description":"The lowercase color of the wine.","in":"query","name":"color","schema":{"type":"string","enum":["red","white","pink"]}},{"description":"Only show the <a href=\"See https://en.wikipedia.org/wiki/En_primeur\">en primeur</a> GlobalWineScores\n","in":"query","name":"is_primeurs","schema":{"type":"boolean","default":false}},{"description":"L-WIN wine identifier (See definition <a href=\"https://www.liv-ex.com/lwin/\" target=\"_blank\">here</a>)\n","in":"query","name":"lwin","example":"1014033","schema":{"type":"string"}},{"description":"L-WIN wine/vintage identifier (See definition <a href=\"https://www.liv-ex.com/lwin/\" target=\"_blank\">here</a>)\n","in":"query","name":"lwin_11","example":"10140332000","schema":{"type":"string"}},{"description":"Number of results to return per page.","in":"query","name":"limit","schema":{"type":"integer","minimum":0,"default":100}},{"description":"The initial index from which to return the results.","in":"query","name":"offset","example":100,"schema":{"type":"integer","minimum":0}},{"description":"Which field to use when ordering the results.","in":"query","name":"ordering","schema":{"type":"string","enum":["date","-date","score","-score"],"default":"-date"}}],"responses":{"200":{"description":"","content":{"application/json":{"examples":{"response":{"value":"{\n \"count\": 1,\n \"next\": null,\n \"previous\": null,\n \"results\": [\n {\n \"wine\": \"Petrus, Pomerol\",\n \"wine_id\": 114959,\n \"wine_slug\": \"petrus-pomerol\",\n \"appellation\": \"Pomerol\",\n \"appellation_slug\": \"pomerol\",\n \"color\": \"Red\",\n \"wine_type\": \"\",\n \"regions\": [\n \"Bordeaux\"\n ],\n \"country\": \"France\",\n \"classification\": null,\n \"vintage\": \"2000\",\n \"date\": \"2016-05-12\",\n \"is_primeurs\": false,\n \"score\": 99.02,\n \"confidence_index\": \"A+\",\n \"journalist_count\": 6,\n \"lwin\": 1014033,\n \"lwin_11\": 10140332000\n }\n ]\n}\n"}}},"application/xml":{"examples":{"response":{"value":"<root>\n <count>1</count>\n <next/>\n <previous/>\n <results>\n <list-item>\n <wine>Petrus, Pomerol</wine>\n <wine_id>114959</wine_id>\n <wine_slug>petrus-pomerol</wine_slug>\n <appellation>Pomerol</appellation>\n <appellation_slug>pomerol</appellation_slug>\n <color>Red</color>\n <wine_type/>\n <regions>\n <list-item>Bordeaux</list-item>\n </regions>\n <country>France</country>\n <classification/>\n <vintage>2000</vintage>\n <date>2016-05-12</date>\n <is_primeurs>False</is_primeurs>\n <score>99.02</score>\n <confidence_index>A+</confidence_index>\n <journalist_count>6</journalist_count>\n <lwin>1014033</lwin>\n <lwin_11>10140332000</lwin_11>\n </list-item>\n </results>\n</root>\n"}}}}}},"summary":"List all historical GWS","tags":["GlobalWineScore"]},"summary":"Historical GWS","description":"<br/> **Requires `Business` plan or above** (see <a href=\"https://www.globalwinescore.com/plans/\">our plans</a> for more information)\n\nGlobalWineScores are re-computed every time a renotation is published, hence resulting in a score evolution over time.\n\nThis API allows you to retrieve the history of all GlobalWineScores.\n"},"/globalwinescores/latest/":{"get":{"description":"Returns the latest GWS available per wine/vintage","parameters":[{"description":"","in":"header","name":"Authorization","example":"Token <YOUR-API-TOKEN>","schema":{"type":"string"}},{"description":"The exact `id` of the wine. Can be used multiple times (e.g `?wine_id=114959&wine_id=114952`) <br/> If you need to find the `wine_id` for your wines, use our <a href=\"https://api.globalwinescore.com/search/\" target=\"_blank\">search page</a>\n","in":"query","name":"wine_id","example":[114959,114952],"explode":true,"schema":{"type":"array","items":{"type":"integer"}}},{"description":"The vintage you want to search against.","in":"query","name":"vintage","example":"2000","schema":{"type":"string"}},{"description":"The lowercase color of the wine.","in":"query","name":"color","schema":{"type":"string","enum":["red","white","pink"]}},{"description":"Only show the <a href=\"See https://en.wikipedia.org/wiki/En_primeur\">en primeur</a> GlobalWineScores\n","in":"query","name":"is_primeurs","schema":{"type":"boolean","default":false}},{"description":"L-WIN wine identifier (See definition <a href=\"https://www.liv-ex.com/lwin/\" target=\"_blank\">here</a>)\n","in":"query","name":"lwin","example":"1014033","schema":{"type":"string"}},{"description":"L-WIN wine/vintage identifier (See definition <a href=\"https://www.liv-ex.com/lwin/\" target=\"_blank\">here</a>)\n","in":"query","name":"lwin_11","example":"10140332000","schema":{"type":"string"}},{"description":"Number of results to return per page.","in":"query","name":"limit","schema":{"type":"integer","minimum":0,"default":100}},{"description":"The initial index from which to return the results.","in":"query","name":"offset","example":100,"schema":{"type":"integer","minimum":0}},{"description":"Which field to use when ordering the results.","in":"query","name":"ordering","schema":{"type":"string","enum":["date","-date","score","-score"],"default":"-date"}}],"responses":{"200":{"description":"","content":{"application/json":{"examples":{"response":{"value":"{\n \"count\": 1,\n \"next\": null,\n \"previous\": null,\n \"results\": [\n {\n \"wine\": \"Petrus, Pomerol\",\n \"wine_id\": 114959,\n \"wine_slug\": \"petrus-pomerol\",\n \"appellation\": \"Pomerol\",\n \"appellation_slug\": \"pomerol\",\n \"color\": \"Red\",\n \"wine_type\": \"\",\n \"regions\": [\n \"Bordeaux\"\n ],\n \"country\": \"France\",\n \"classification\": null,\n \"vintage\": \"2000\",\n \"date\": \"2016-05-12\",\n \"is_primeurs\": false,\n \"score\": 99.02,\n \"confidence_index\": \"A+\",\n \"journalist_count\": 6,\n \"lwin\": 1014033,\n \"lwin_11\": 10140332000\n }\n ]\n}\n"}}},"application/xml":{"examples":{"response":{"value":"<root>\n <count>1</count>\n <next/>\n <previous/>\n <results>\n <list-item>\n <wine>Petrus, Pomerol</wine>\n <wine_id>114959</wine_id>\n <wine_slug>petrus-pomerol</wine_slug>\n <appellation>Pomerol</appellation>\n <appellation_slug>pomerol</appellation_slug>\n <color>Red</color>\n <wine_type/>\n <regions>\n <list-item>Bordeaux</list-item>\n </regions>\n <country>France</country>\n <classification/>\n <vintage>2000</vintage>\n <date>2016-05-12</date>\n <is_primeurs>False</is_primeurs>\n <score>99.02</score>\n <confidence_index>A+</confidence_index>\n <journalist_count>6</journalist_count>\n <lwin>1014033</lwin>\n <lwin_11>10140332000</lwin_11>\n </list-item>\n </results>\n</root>\n"}}}}}},"summary":"List all latest GWS","tags":["GlobalWineScore"]},"summary":"GWS"}},"servers":[{"url":"https://api.globalwinescore.com"}],"components":{"securitySchemes":{"TokenAuthentication":{"description":"See Authentication section above","in":"header","name":"Authorization","type":"apiKey"}}}}