|
| 1 | +# Go API client for swagger |
| 2 | + |
| 3 | +## Important An **[API key](https://chompthis.com/api/)** is required for access to this API. * Get a **Food Data API** key at **[https://chompthis.com/api](https://chompthis.com/api/)**. * Get a **Recipe Data API** key at **[https://chompthis.com/api/recipes](https://chompthis.com/api/recipes/)**. ### Getting Started * Subscribe to the **[Food Data API](https://chompthis.com/api/#pricing)** or the **[Recipe Data API](https://chompthis.com/api/recipes/#pricing)**. * Scroll down and click the \"**Authorize**\" button. * Enter your API key into the \"**value**\" input, click the \"**Authorize**\" button, then click the \"**Close**\" button. * Scroll down to the section titled \"**default**\" and click on the API endpoint you wish to use. * Click the \"**Try it out**\" button. * Enter the information the endpoint requires. * Click the \"**Execute**\" button. ### Example * Branded food response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)** * Ingredient response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)** * Recipe response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/example-recipe-response.json)** * Error response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/error-response-object.json)** ### How Do I Find My API Key? * Your API key was sent to the email address you used to create your subscription. * You will also find your API key in the **[Client Center](https://chompthis.com/api/manage.php)**. * Read **[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)** for more information. ### I'm a Premium subscriber. How do I access the API? * All Premium subscribers must pass in a unique user ID for each user on their platform that is accessing data from the Chomp API. A user ID can be any string of letters and numbers that you assign to your user. Simply add \"user_id\" as a URL parameter when calling the API. *You must add a \"user_id\" URL parameter to every call you make to ANY endpoint.* * **Example** > ```ENDPOINT.php?api_key=API_KEY&code=CODE&user_id=USER_ID``` ### Helpful Links * **Help & Support** * [Knowledge Base »](https://desk.zoho.com/portal/chompthis/kb/chomp) * [Support »](https://chompthis.com/api/ticket-new.php) * [Client Center »](https://chompthis.com/api/manage.php) * **Pricing** * [Food Data API Subscription Options »](https://chompthis.com/api/) * [Recipe Data API Subscription Options »](https://chompthis.com/api/recipes/) * [Food Data API Cost Calculator »](https://chompthis.com/api/cost-calculator.php) * [Recipe Data API Cost Calculator »](https://chompthis.com/api/recipes/cost-calculator.php) * **Guidelines** * [Terms & License »](https://chompthis.com/api/terms.php) * [Attribution »](https://chompthis.com/api/docs/attribution.php) |
| 4 | + |
| 5 | +## Overview |
| 6 | +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. |
| 7 | + |
| 8 | +- API version: 1.0.0-oas3 |
| 9 | +- Package version: 1.0.0 |
| 10 | +- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen |
| 11 | + |
| 12 | +## Installation |
| 13 | +Put the package under your project folder and add the following in import: |
| 14 | +```golang |
| 15 | +import "./swagger" |
| 16 | +``` |
| 17 | + |
| 18 | +## Documentation for API Endpoints |
| 19 | + |
| 20 | +All URIs are relative to *https://chompthis.com/api/v2* |
| 21 | + |
| 22 | +Class | Method | HTTP request | Description |
| 23 | +------------ | ------------- | ------------- | ------------- |
| 24 | +*DefaultApi* | [**FoodBrandedBarcodePhpGet**](docs/DefaultApi.md#foodbrandedbarcodephpget) | **Get** /food/branded/barcode.php | Get a branded food item using a barcode |
| 25 | +*DefaultApi* | [**FoodBrandedNamePhpGet**](docs/DefaultApi.md#foodbrandednamephpget) | **Get** /food/branded/name.php | Get a branded food item by name |
| 26 | +*DefaultApi* | [**FoodBrandedSearchPhpGet**](docs/DefaultApi.md#foodbrandedsearchphpget) | **Get** /food/branded/search.php | Get data for branded food items using various search parameters |
| 27 | +*DefaultApi* | [**FoodIngredientSearchPhpGet**](docs/DefaultApi.md#foodingredientsearchphpget) | **Get** /food/ingredient/search.php | Get raw/generic food ingredient item(s) |
| 28 | +*DefaultApi* | [**RecipeIdPhpGet**](docs/DefaultApi.md#recipeidphpget) | **Get** /recipe/id.php | Get a recipe by ID |
| 29 | +*DefaultApi* | [**RecipeIngredientPhpGet**](docs/DefaultApi.md#recipeingredientphpget) | **Get** /recipe/ingredient.php | Get recipes using a list of ingredients |
| 30 | +*DefaultApi* | [**RecipeRandomPhpGet**](docs/DefaultApi.md#reciperandomphpget) | **Get** /recipe/random.php | Get random popular recipes |
| 31 | +*DefaultApi* | [**RecipeSearchPhpGet**](docs/DefaultApi.md#recipesearchphpget) | **Get** /recipe/search.php | Get recipes using a title and optional filters |
| 32 | + |
| 33 | +## Documentation For Models |
| 34 | + |
| 35 | + - [BrandedFoodObject](docs/BrandedFoodObject.md) |
| 36 | + - [BrandedFoodObjectCountryDetails](docs/BrandedFoodObjectCountryDetails.md) |
| 37 | + - [BrandedFoodObjectDietFlags](docs/BrandedFoodObjectDietFlags.md) |
| 38 | + - [BrandedFoodObjectDietLabels](docs/BrandedFoodObjectDietLabels.md) |
| 39 | + - [BrandedFoodObjectDietLabelsGlutenFree](docs/BrandedFoodObjectDietLabelsGlutenFree.md) |
| 40 | + - [BrandedFoodObjectDietLabelsVegan](docs/BrandedFoodObjectDietLabelsVegan.md) |
| 41 | + - [BrandedFoodObjectDietLabelsVegetarian](docs/BrandedFoodObjectDietLabelsVegetarian.md) |
| 42 | + - [BrandedFoodObjectItems](docs/BrandedFoodObjectItems.md) |
| 43 | + - [BrandedFoodObjectNutrients](docs/BrandedFoodObjectNutrients.md) |
| 44 | + - [BrandedFoodObjectPackage](docs/BrandedFoodObjectPackage.md) |
| 45 | + - [BrandedFoodObjectPackagingPhotos](docs/BrandedFoodObjectPackagingPhotos.md) |
| 46 | + - [BrandedFoodObjectPackagingPhotosFront](docs/BrandedFoodObjectPackagingPhotosFront.md) |
| 47 | + - [BrandedFoodObjectPackagingPhotosIngredients](docs/BrandedFoodObjectPackagingPhotosIngredients.md) |
| 48 | + - [BrandedFoodObjectPackagingPhotosNutrition](docs/BrandedFoodObjectPackagingPhotosNutrition.md) |
| 49 | + - [BrandedFoodObjectServing](docs/BrandedFoodObjectServing.md) |
| 50 | + - [IngredientObject](docs/IngredientObject.md) |
| 51 | + - [IngredientObjectCalorieConversionFactor](docs/IngredientObjectCalorieConversionFactor.md) |
| 52 | + - [IngredientObjectComponents](docs/IngredientObjectComponents.md) |
| 53 | + - [IngredientObjectItems](docs/IngredientObjectItems.md) |
| 54 | + - [IngredientObjectNutrients](docs/IngredientObjectNutrients.md) |
| 55 | + - [IngredientObjectPortions](docs/IngredientObjectPortions.md) |
| 56 | + - [RecipeObject](docs/RecipeObject.md) |
| 57 | + - [RecipeObjectAttributes](docs/RecipeObjectAttributes.md) |
| 58 | + - [RecipeObjectIngredients](docs/RecipeObjectIngredients.md) |
| 59 | + - [RecipeObjectItems](docs/RecipeObjectItems.md) |
| 60 | + - [RecipeObjectMeta](docs/RecipeObjectMeta.md) |
| 61 | + - [RecipeObjectMetaImages](docs/RecipeObjectMetaImages.md) |
| 62 | + - [RecipeObjectNutrients](docs/RecipeObjectNutrients.md) |
| 63 | + - [RecipeObjectNutrientsCalories](docs/RecipeObjectNutrientsCalories.md) |
| 64 | + |
| 65 | +## Documentation For Authorization |
| 66 | + |
| 67 | +## ApiKeyAuth |
| 68 | +- **Type**: API key |
| 69 | + |
| 70 | +Example |
| 71 | +```golang |
| 72 | +auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ |
| 73 | + Key: "APIKEY", |
| 74 | + Prefix: "Bearer", // Omit if not necessary. |
| 75 | +}) |
| 76 | +r, err := client.Service.Operation(auth, args) |
| 77 | +``` |
| 78 | + |
| 79 | +## Author |
| 80 | + |
| 81 | + |
0 commit comments