ingredientSearch
Search for ingredients based on criteria
/ingredients/search
Usage and SDK Samples
curl -X GET "https://versa-gateway-40935yiy.uc.gateway.dev/ingredients/search?limit=&query="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
DefaultApi apiInstance = new DefaultApi();
String query = query_example; // String | What ingredient query to search for
BigDecimal limit = 8.14; // BigDecimal | Specify the maximum number of ingredients
try {
array[IngredientExample] result = apiInstance.ingredientSearch(query, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#ingredientSearch");
e.printStackTrace();
}
}
}
import io.swagger.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String query = query_example; // String | What ingredient query to search for
BigDecimal limit = 8.14; // BigDecimal | Specify the maximum number of ingredients
try {
array[IngredientExample] result = apiInstance.ingredientSearch(query, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#ingredientSearch");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: api_key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"key"];
String *query = query_example; // What ingredient query to search for
BigDecimal *limit = 8.14; // Specify the maximum number of ingredients (optional)
DefaultApi *apiInstance = [[DefaultApi alloc] init];
// Search for ingredients based on criteria
[apiInstance ingredientSearchWith:query
limit:limit
completionHandler: ^(array[IngredientExample] output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var ApiVersa = require('api_versa');
var defaultClient = ApiVersa.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['key'] = "Token"
var api = new ApiVersa.DefaultApi()
var query = query_example; // {String} What ingredient query to search for
var opts = {
'limit': 8.14 // {BigDecimal} Specify the maximum number of ingredients
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.ingredientSearch(query, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class ingredientSearchExample
{
public void main()
{
// Configure API key authorization: api_key
Configuration.Default.ApiKey.Add("key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("key", "Bearer");
var apiInstance = new DefaultApi();
var query = query_example; // String | What ingredient query to search for
var limit = 8.14; // BigDecimal | Specify the maximum number of ingredients (optional)
try
{
// Search for ingredients based on criteria
array[IngredientExample] result = apiInstance.ingredientSearch(query, limit);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.ingredientSearch: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer');
$api_instance = new Swagger\Client\Api\DefaultApi();
$query = query_example; // String | What ingredient query to search for
$limit = 8.14; // BigDecimal | Specify the maximum number of ingredients
try {
$result = $api_instance->ingredientSearch($query, $limit);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->ingredientSearch: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;
# Configure API key authorization: api_key
$WWW::SwaggerClient::Configuration::api_key->{'key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'key'} = "Bearer";
my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $query = query_example; # String | What ingredient query to search for
my $limit = 8.14; # BigDecimal | Specify the maximum number of ingredients
eval {
my $result = $api_instance->ingredientSearch(query => $query, limit => $limit);
print Dumper($result);
};
if ($@) {
warn "Exception when calling DefaultApi->ingredientSearch: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
swagger_client.configuration.api_key['key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.DefaultApi()
query = query_example # String | What ingredient query to search for
limit = 8.14 # BigDecimal | Specify the maximum number of ingredients (optional)
try:
# Search for ingredients based on criteria
api_response = api_instance.ingredient_search(query, limit=limit)
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->ingredientSearch: %s\n" % e)
Parameters
Query parameters
Name | Description |
---|---|
limit |
BigDecimal
Specify the maximum number of ingredients
|
query* |
String
What ingredient query to search for
Required
|