<commit_before># Bergenholm REST API Reference


## Host APIs

Bergenholm has 6 host APIs. HTTP bodies of requests/responses are JSON.

### ```GET /api/1.0/hosts/```

Retrieve host list.

HTTP response:
- Status code:
  -  200 (success)
- Body:
  <pre>
  {
    "hosts": [
      "<uuid>",
      "<uuid>",
      ...,
    ]
  }
  </pre>


### ```GET /api/1.0/hosts/?<param>=<value>&<param>=<value>&...$```

Retrieve filtered host list, hosts have parameters matching the condition specified as query parameters.
Matching is exact match. You can put multiple conditions and they will work as an AND condition.

HTTP response:
- Status code:
  -  200 (success)
- Body:
  <pre>
  {
    "hosts": [
      "<uuid>",
      "<uuid>",
      ...,
    ]
  }
  </pre>

### ```GET /api/1.0/hosts/<uuid>```

Retrieve host parameters.

HTTP request:
- uuid: host id

HTTP response:
- Status code:
  - 200 (success)<commit_msg>Update API.md<commit_after># Bergenholm REST API Reference


## Host APIs

Bergenholm has 6 host APIs. HTTP bodies of requests/responses are JSON.

### ```GET /api/1.0/hosts/```

Retrieve host list.

HTTP response:
- Status code:
  -  200 (success)
- Body:
  <pre>
  {
    "hosts": [
      "<uuid>",
      "<uuid>",
      ...,
    ]
  }
  </pre>


### ```GET /api/1.0/hosts/?<param>=<value>&<param>=<value>&...```

Retrieve filtered host list, hosts have parameters matching the condition specified as query parameters.
Matching is exact match. You can put multiple conditions and they will work as an AND condition.

HTTP response:
- Status code:
  -  200 (success)
- Body:
  <pre>
  {
    "hosts": [
      "<uuid>",
      "<uuid>",
      ...,
    ]
  }
  </pre>

### ```GET /api/1.0/hosts/<uuid>```

Retrieve host parameters.

HTTP request:
- uuid: host id

HTTP response:
- Status code:
  - 200 (success)
{'fraction_non_alphanumeric': 0.16859504132231404, 'fraction_numerical': 0.017630853994490357, 'mean_word_length': 2.596039603960396, 'pattern_counts': {'":': 4, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '5898549', 'n_tokens_mistral': 659, 'n_tokens_neox': 627, 'n_words': 192}