<commit_before># api
The API server that powers classmere + API reference sheet.

## API Reference (In beta)
### Courses
#### List all courses
**GET** `http://api.classmere.com/v1/courses`
Returns a list of all course names and abbreviations in the classmere database.
##### Example Response
```json
[
	{
		"course": "BIOCULTURAL PERSPECTIVES ON HUMAN REPRODUCTION",
		"abbr": "ANTH 449"
	},
	{...}
]
```

#### Retrieve a course
**GET** `http://api.classmere.com/v1/courses/course_abbr`
Returns all information about a particular course, including information about each of its individual sections.
Note: "credits" is sometimes a range, e.g. "1-16", therefore it is returned as a string.
##### Example Response
```json
{
  "title": "Applied Physiology of Reproduction",
  "abbr": "ANS 327",
  "credits": "5",
  "description": "Principles, techniques and recent development in semen collection, 
  evaluation, extension and preservation; artificial insemination, estrus detection 
  and synchronization; pregnancy diagnosis and embryo transfer.",
  "sections": [
    {
      "term": "Fall 2015",
      "startDate": "2015-09-24",
      "endDate": "2015-12-04",
      "session": null,
      "crn": 10037,
      "sectionNumber": 1,
      "credits": "5",
      "instructor": "<NAME>.",
      "days": "TR",
      "startTime": "08:30:00",
      "endTime": "09:50:00",
      "location": "WITH 217",
      "campus": "Corv",
      "type": "Lecture",
      "status": "Open",
      "enrollCap": 30,
      "enrolled": 0,
      "waitlistCap": 0,
      "waitlisted": 0,
      "fees": "$20.00",
      "restrictions": "Prereqs: (ANS 316 [D-] and ANS 317 [D-] )",
      "comments": null
    },
    {...}
  ]
}
```

### Search
Search only works for courses currently. More functionality will be added in the future.
#### Search for courses
**GET** `http://api.classmere.com/v1/search/courses`
Returns a list of up to 100 matching courses, not including invividual sections.
##### Parameters
| Name   | Type     | Description           |
| ------ | -------- | --------------------- |
| `q`    | `string` | The search terms      |<commit_msg>Updated API doc in README<commit_after># api
The API server that powers classmere + API reference sheet.

## API Reference (In beta)
### Courses
#### List all courses
**GET** `http://api.classmere.com/v1/courses`
Returns a list of all course names and abbreviations in the classmere database.
##### Example Response
```json
[
	{
		"course": "BIOCULTURAL PERSPECTIVES ON HUMAN REPRODUCTION",
		"abbr": "ANTH 449"
	},
	{...}
]
```

#### Retrieve a course
**GET** `http://api.classmere.com/v1/courses/course_abbr`
Returns all information about a particular course, including information about each of its individual sections.
Note: "credits" is sometimes a range, e.g. "1-16", therefore it is returned as a string.
##### Example Response
```json
{
  "title": "Applied Physiology of Reproduction",
  "abbr": "ANS 327",
  "credits": "5",
  "description": "Principles, techniques and recent development in semen collection, 
  evaluation, extension and preservation; artificial insemination, estrus detection 
  and synchronization; pregnancy diagnosis and embryo transfer.",
  "sections": [
    {
      "term": "Fall 2015",
      "startDate": "2015-09-24",
      "endDate": "2015-12-04",
      "session": null,
      "crn": 10037,
      "sectionNumber": 1,
      "credits": "5",
      "instructor": "<NAME>.",
      "days": "TR",
      "startTime": "08:30:00",
      "endTime": "09:50:00",
      "location": "WITH 217",
      "campus": "Corv",
      "type": "Lecture",
      "status": "Open",
      "enrollmentCap": 30,
      "enrolled": 50,
      "waitlisted": 3,
      "waitlistCap": 10,
      "fees": "$20.00",
      "restrictions": "Prereqs: (ANS 316 [D-] and ANS 317 [D-] )",
      "comments": null
    },
    {...}
  ]
}
```

### Search
Search only works for courses currently. More functionality will be added in the future.
#### Search for courses
**GET** `http://api.classmere.com/v1/search/courses`
Returns a list of up to 100 matching courses, not including invividual sections.
##### Parameters
| Name   | Type     | Description           |
| ------ | -------- | --------------------- |
| `q`    | `string` | The search terms      |
{'fraction_non_alphanumeric': 0.1732394366197183, 'fraction_numerical': 0.03474178403755868, 'mean_word_length': 3.008466603951082, 'pattern_counts': {'":': 58, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2289629', 'n_tokens_mistral': 1492, 'n_tokens_neox': 1319, 'n_words': 432}