HCG Web Services Documentation
6 July 2009 • Version 1.0

FAQs API

The FAQs API is designed to provide access to the Hain Celestial Groups FAQ databases.

Base URL : http://api.hcgweb.net/{version}/faqs/

The current version is v1.

The HTTP Methods used are GET and POST.

Note: The GET method is not really used in the sense that you do not write a query statement with key/value pairs. The values are separated by slashes, and all required values must be present in the order indicated.

Available Services:

faqCategoryList

Returns a list of FAQ categories for the specified site. The list of categories contains information that allows you to build a hierarchical tree from the data. The first record is the root node and can be ignored in most cases.

URL Format

http://api.hcgweb.net/{version}/faqs/faqCategoryList/{api-key}/{format}/{site-id}

Parameter Required Description Options and Samples
version Yes The version of the API that you are using. v1
api-key Yes The unique api key provided by hcgWeb. 45ghe8561frD
format Yes The format you would like the data returned in. xml
json
site-id Yes The alpha code used to identify which HCG site you want data about. eb = Earth's Best

See a complete list of codes.

Example Links

Data Dictionary

The basic structure of the data is

faqCategoryList
{
   source
   response
   {
      FaqCategories 
      [
         (FaqCategory -- may be multiple records)
         {
            <FAQ category fields>
         }
      ]
   },
   status
}

The FAQ category fields are defined in an Excel spreadsheet:

faqList

Returns category information and a list of associated FAQ detail records for the specified FAQ category.

URL Format

http://api.hcgweb.net/{version}/faqs/faqList/{api-key}/{format}/{site-id}/{id-type}/{category-id}

Parameter Required Description Options and Samples
version Yes The version of the API that you are using. v1
api-key Yes The unique api key provided by hcgWeb. 45ghe8561frD
format Yes The format you would like the data returned in. xml
json
site-id Yes The alpha code used to identify which HCG site you want data about. eb = Earth's Best

See a complete list of codes.
id-type Yes The type of information being passed to identify the category. id - the category's record id number
code - the alpha-numeric code based on the category's name
category-id Yes The FAQ list identifier according to the indicated id-type. 44 = id
dc_allergies = code

Example Links

Data Dictionary

The basic structure of the data is

faqList
{
   source
   response
   {
      FaqCategory (optional, if category is specified)
      {
         <FAQ category fields>
      },
      Faqs
      [
         (Faq -- may be multiple records)
         {
            <FAQ fields>
         }
      ]
   },
   status
}

The FAQ and FAQ Category fields are defined in Excel spreadsheets:

faqDetail

Returns a complete FAQ detail record for the specified FAQ

URL Format

http://api.hcgweb.net/{version}/faqs/faqDetail/{api-key}/{format}/{site-id}/{faq-id}/{answer-id}

Parameter Required Description Options and Samples
version Yes The version of the API that you are using. v1
api-key Yes The unique api key provided by hcgWeb. 45ghe8561frD
format Yes The format you would like the data returned in. xml
json
site-id Yes The alpha code used to identify which HCG site you want data about. eb = Earth's Best

See a complete list of codes.
faq-id Yes The numeric ID of the desired FAQ. 554
answer-id No The numeric ID of the FAQ answer (there may be several). 554

Example Links

Data Dictionary

The basic structure of the data is

faqDetail
{
   source
   response
   {
      Faq
      {
         <FAQ fields>
      }
   },
   status
}

The FAQ fields are defined in Excel spreadsheets:

faqSearch

Allows the user to search the FAQs database. Returns a list of FAQs that match the specified search words. All FAQs in all categories associated with the site are searched.

The data may be submitted via either the GET or POST method.

URL Format

Via GET:

http://api.hcgweb.net/{version}/faqs/faqSearch/{api-key}/{format}/{site-id}/{Words}

Via POST:

http://api.hcgweb.net/{version}/faqs/faqSearch

Parameter Required Description Options and Samples
version Yes The version of the API that you are using. v1
api-key Yes The unique api key provided by hcgWeb. 45ghe8561frD
format Yes The format you would like the data returned in. xml
json
site-id Yes The alpha code used to identify which HCG site you want data about. eb = Earth's Best

See a complete list of codes.
Words Yes A list of search words. This must be URL-encoded if it is being submitted as part of the URL. gluten%20free

Example Links

Data Dictionary

The basic structure of the data is

faqSearch
{
   source
   response 
   {
      Search
      {
         SiteID
         Words
         ResultsFound
      }
      Faqs
      [
         (Faq -- may be multiple records)
         {
            <FAQ fields>
         }
      ]
   },
   status
}

The FAQ fields are defined in Excel spreadsheets:

faqPopularSearches

Returns information that make it possible to create a clickable list of popular searches near the search form.

URL Format

http://api.hcgweb.net/{version}/faqPopularSearches/{api-key}/{format}/{site-id}/{days}/{limit}

Parameter Required Description Options and Samples
version Yes The version of the API that you are using. v1
api-key Yes The unique api key provided by hcgWeb. 45ghe8561frD
format Yes The format you would like the data returned in. xml
json
site-id Yes The alpha code used to identify which HCG site you want data about. eb = Earth's Best

See a complete list of codes.
days No The number of days to be counted in the popular searches. For example, to see the popular searches in the previous week, you would indicate 7 days. 7
Default: 30 days
limit No The number of top searches to supply. If there have not been enough searches, fewer results may be supplied. 7
Default: 5

Example Links

Data Dictionary

The basic structure of the data is

faqPopularSearches
{
   source
   response
   {
      Searches
      [
         (Search -- may be multiple records)
         {
            Keyword  (the keyword searched)
            Number   (the number of times it was searched)
         }
      ]
   },
   status
}