<commit_before># cmr-search-app

Provides a public search API for concepts in the CMR.

## Example CURL requests

### Common GET parameters/headers

#### Parameters

 * page_size - number of results per page - default is 10, max is 2000
 * pretty - return formatted results

#### Headers

  * Accept - specifies the format to return search results in. Default is xml.
    * `curl -H "Accept: application/xml" -i "http://localhost:3003/collections"`
    * `curl -H "Accept: text/csv" -i "http://localhost:3003/granules"`
    * `curl -H "Accept: application/atom+xml" -i "http://localhost:3003/granules"`
    * `curl -H "Accept: application/json" -i "http://localhost:3003/granules"`

### Search for Collections

#### Find all collections

    curl "http://localhost:3003/collections"

#### Find collections by concept id

A CMR concept id is in the format `<concept-type-prefix> <unique-number> "-" <provider-id>`

  * `concept-type-prefix` is a single capital letter prefix indicating the concept type. "C" is used for collections
  * `unique-number` is a single number assigned by the CMR during ingest.
  * `provider-id` is the short name for the provider. i.e. "LPDAAC_ECS"

Example: `C123456-LPDAAC_ECS`

    curl "http://localhost:3003/collections?concept_id\[\]=C123456-LPDAAC_ECS"<commit_msg>CMR-627: Added documentation for CMR-Hits and CMR-Took headers.<commit_after># cmr-search-app

Provides a public search API for concepts in the CMR.

## Example CURL requests

### Common GET parameters/headers

#### Parameters

 * page_size - number of results per page - default is 10, max is 2000
 * pretty - return formatted results

#### Headers

  * Accept - specifies the format to return search results in. Default is xml.
    * `curl -H "Accept: application/xml" -i "http://localhost:3003/collections"`
    * `curl -H "Accept: text/csv" -i "http://localhost:3003/granules"`
    * `curl -H "Accept: application/atom+xml" -i "http://localhost:3003/granules"`
    * `curl -H "Accept: application/json" -i "http://localhost:3003/granules"`

  * The response headers include CMR-Hits and CMR-Took which indicate the number of result hits
     and the time to build and execute the query, respectively.

### Search for Collections

#### Find all collections

    curl "http://localhost:3003/collections"

#### Find collections by concept id

A CMR concept id is in the format `<concept-type-prefix> <unique-number> "-" <provider-id>`

  * `concept-type-prefix` is a single capital letter prefix indicating the concept type. "C" is used for collections
  * `unique-number` is a single number assigned by the CMR during ingest.
  * `provider-id` is the short name for the provider. i.e. "LPDAAC_ECS"

Example: `C123456-LPDAAC_ECS`

    curl "http://localhost:3003/collections?concept_id\[\]=C123456-LPDAAC_ECS"
{'fraction_non_alphanumeric': 0.1238875044499822, 'fraction_numerical': 0.03097187611249555, 'mean_word_length': 3.86159169550173, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2665648', 'n_tokens_mistral': 945, 'n_tokens_neox': 850, 'n_words': 304}