INTEGRITY API Resources

Use of this API is subject to the Terms of Service as outlined by USDA's Agricultural Marketing Service.

The Organic INTEGRITY Database (INTEGRITY) API allows developers to incorporate organic operation data into their applications. INTEGRITY offers REST & SOAP access to get a download of all/filtered organic operations in the system in XML or JSON format depending on the request.

New URL for SOAP/REST Public API

https://organicapi.ams.usda.gov/IntegrityPubDataServices/OidPublicDataService.svc?api_key=APIKEY_STRING

Operations Data

INTEGRITY’s DownloadAPI OIDPublicDataService has method GetAllOperationsPublicData with the following URL to download a Zip file of all the organic operations in XML format from your browser. An API key is required to be passed in the URL.
https://organicapi.ams.usda.gov/IntegrityPubDataServices/OidPublicDataService.svc/rest/GetAllOperationsPublicData?api_key=APIKEY_STRING

Get an API Key

Anyone may access and use the API. However, a data.gov API key must be incorporated into the API request. INTEGRITY uses the shared, interagency service api.data.gov to provide an optimized experience for users. After you register, you can use one key to gain universal access to any Open Government data using the service. The API key can be obtained at https://api.data.gov/signup/

Rate Limits

We currently limit the number of API requests to a default rate of 1,000 requests per hour per API Key. Exceeding this limit will cause your API key to be temporarily blocked for one hour. More detailed information on rate limits and other general information can be found at http://api.data.gov/docs/

New Methods for SOAP/REST Public API

The service can be called using SOAP or REST. The Rest response can be in XML or JSON format depending on the request. The new methods are listed below. An API key is required to be passed in the URL for every method.

WSDL Link:

https://organicapi.ams.usda.gov/IntegrityPubDataServices/OidPublicDataService.svc?wsdl&api_key=APIKEY_STRING

SOAP API URL:

https://organicapi.ams.usda.gov/IntegrityPubDataServices/OidPublicDataService.svc/soap?api_key=APIKEY_STRING

Rest API Methods:

Get Methods:

Method: GetAllOperationsPublicData();

Description: Returns a Zip file of all the organic operations in XML format.

URL: https://organicapi.ams.usda.gov/IntegrityPubDataServices/OidPublicDataService.svc/rest/GetAllOperationsPublicData?api_key=APIKEY_STRING

Post Methods:

Method: Operations(List<string> countries, List<string> states, DateTime? fromDate, DateTime? toDate, int startIdx, int count);

Description: Returns subset of the certified organic operations based on countries, states, From & To Status Effective Date filters.

URL: https://organicapi.ams.usda.gov/IntegrityPubDataServices/OidPublicDataService.svc/rest/Operations?api_key=APIKEY_STRING

Method: OperationsCount(List<string> countries, List<string> states, DateTime? fromDate, DateTime? toDate);

Description: Returns certified organic operations count based on countries, states, From & To Status Effective Date filters.

URL: https://organicapi.ams.usda.gov/IntegrityPubDataServices/OidPublicDataService.svc/rest/Operations/Count?api_key=APIKEY_STRING

Method: Items(string operationId, int startIdx, int count);

Description: Returns Products/Items for selected Nop Operation ID.

URL: https://organicapi.ams.usda.gov/IntegrityPubDataServices/OidPublicDataService.svc/rest/Items?api_key=APIKEY_STRING

Method: ItemsCount(string operationId);

Description: Returns count of Products/Items for selected Nop Operation ID.

URL: https://organicapi.ams.usda.gov/IntegrityPubDataServices/OidPublicDataService.svc/rest/Items/Count?api_key=APIKEY_STRING

Method: Operation(string operationId);

Description: Returns all public information for selected certified organic operation.

URL: https://organicapi.ams.usda.gov/IntegrityPubDataServices/OidPublicDataService.svc/rest/Operations/Operation?api_key=APIKEY_STRING

C# code sample for Operations Data:

class Program 
    {
        static void Main(string[] args) 
        {
          CallRestSVC(); 
        }


        public  static void CallRestSVC() 
        {
            try 
            {
                WebClient wc = new WebClient(); 
                wc.DownloadFile("https://organicapi.ams.usda.gov/IntegrityPubDataServices/OidPublicDataService.svc/rest/
                GetAllOperationsPublicData?&api_key=APIKEY_STRING ", "Operations.zip"); 
            } 

            catch (Exception ex) 
            {
                Console.WriteLine(ex.ToString());  
            } 

        }
    }
    

XML Data Element

The below table specifies Elements in the Operations XML data from GetAllOperationsPublicData method

Operation Level Elements:

XML Tag Name Name
op_certifierName Certifier Name
op_nopOpID Operation ID
op_name Operation Name
op_otherNames Other/Former Names
op_clientID Client ID
op_contFirstName Contact First Name
op_contLastName Contact Last Name
op_status Operation Certification Status
op_statusEffectiveDate Effective Date of Operation Status
op_nopAnniversaryDate NOP Anniversary Date
op_lastUpdatedDate Data as of Date
opSC_CR CROPS Certification Status
opSC_CR_ED Effective Date of CROPS Status
opSC_LS LIVESTOCK Certification Status
opSC_LS_ED Effective Date of LIVESTOCK Status
opSC_WC WC WILD CROPS Certification Status
opSC_WC_ED Effective Date of WILD CROPS Status
opSC_HANDLING HANDLING Certification Status
opSC_HANDLING_ED Effective Date of HANDLING Status
opPA_line1 Physical Address: Street 1
opPA_line2 Street 2
opPA_city City
opPA_state State/Province
opPA_country Country
opPA_zip ZIP/Postal Code
opMA_line1 Mailing Address: Street 1
opMA_line2 Street 2
opMA_city City
opMA_state State/Province
opMA_country Country
opMA_zip ZIP/Postal Code
op_phone Phone
op_email Email
op_url Website URL
op_opExtraInfo Additional Information
opEx_broker Broker
opEx_csa Community Supported Agriculture (CSA)
opEx_copacker Co-Packer
opEx_dairy Dairy
opEx_distributor Distributor
opEx_marketerTrader Marketer/Trader
opEx_restaurant Restaurant
opEx_retailer Retail Food Establishment
opEx_poultry Poultry
opEx_privateLabeler Private Labeler
opEx_slaughterHouse Slaughterhouse
opEx_storage Storage
opEx_growerGroup Grower Group
opCert_url Organic Certificate [URL]

Item Level Elements:

XML Tag Name Name
ci_nopOpID Operation ID
ci_certNumber Certificate Number
ci_nopScope NOP Scope
ci_nopCategory NOP Category
ci_nopCatID NOP Category ID
ci_nopCatName NOP Item Name
ci_nopItemID NOP Item ID
ci_itemList Other Item
ci_varieties Item Varieties
ci_status NOP Certification Status
ci_statusEffectiveDate NOP Status Effective Date
ci_organic100 100% Organic
ci_organic Organic
ci_madeWithOrganic Made with Organic

Additional Information: