Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/deep-space-cartel/fooddata-central-client-go/v2

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/deep-space-cartel/fooddata-central-client-go/v2

  • v2.0.0-20241023134035-8b090166cbdf
  • Source
  • Go
  • Socket score

Version published
Created
Source

Go API client for swagger

The FoodData Central API provides REST access to FoodData Central (FDC). It is intended primarily to assist application developers wishing to incorporate nutrient data into their applications or websites. To take full advantage of the API, developers should familiarize themselves with the database by reading the database documentation available via links on Data Type Documentation. This documentation provides the detailed definitions and descriptions needed to understand the data elements referenced in the API documentation. Additional details about the API including rate limits, access, and licensing are available on the FDC website

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

Installation

Put the package under your project folder and add the following in import:

import "./swagger"

Documentation for API Endpoints

All URIs are relative to https://api.nal.usda.gov/fdc

ClassMethodHTTP requestDescription
FDCApiGetFoodGet /v1/food/{fdcId}Fetches details for one food item by FDC ID
FDCApiGetFoodsGet /v1/foodsFetches details for multiple food items using input FDC IDs
FDCApiGetFoodsListGet /v1/foods/listReturns a paged list of foods, in the 'abridged' format
FDCApiGetFoodsSearchGet /v1/foods/searchReturns a list of foods that matched search (query) keywords
FDCApiGetJsonSpecGet /v1/json-specReturns this documentation in JSON format
FDCApiGetYamlSpecGet /v1/yaml-specReturns this documentation in JSON format
FDCApiPostFoodsPost /v1/foodsFetches details for multiple food items using input FDC IDs
FDCApiPostFoodsListPost /v1/foods/listReturns a paged list of foods, in the 'abridged' format
FDCApiPostFoodsSearchPost /v1/foods/searchReturns a list of foods that matched search (query) keywords

Documentation For Models

Documentation For Authorization

ApiKeyAuth

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

Author

  1. U.S. Department of Agriculture. Agricultural Research Service.

Sources

Dependencies

go install -v github.com/go-critic/go-critic/cmd/gocritic@latest
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
go install golang.org/x/tools/cmd/goimports@latest

FAQs

Package last updated on 23 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc