Yo Momma API

example workflow Heroku

An API that insults yo momma

yomamma-api.herokuapp.com

Development

This API is based on FastAPI and currently hosted on Heroku

To contribute, see this

Acknowledgements

Thanks to rdegges and szymex for the jokes. Yo momma would be proud, atleast now.

License

This software is licensed under the terms of the MIT License.

GET / Home

This method doesn’t actually do anything

Parameters

None

Response

Just sends back yo momma

Status: 200 OK { "joke": "Yo momma" }

No purpose for this method tbh.

GET /jokes Random Jokes

This method returns a random joke (or jokes)

Parameters

count: Returns count number of jokes. Optional Default value: 1

Example:

/jokes?count={count}

Response

JSON Response of random joke(s)

If no count parameter is given:

Status: 200 OK { "joke": "Yo momma is so poor that she has to take the trash IN." }

If count parameter is given as 3:

Status: 200 OK [ { "joke": "Yo momma is so ugly that she gives Freddy Kreuger nightmares." }, { "joke": "Yo momma is twice the man you are." }, { "joke": "Yo momma is like the new AOL 4.0: Fun, Fast, Easy and Free!" } ]

For invalid count parameter:

Status: 404 NOT FOUND { "detail": "Invalid count paramter" }

GET /jokes/{index} Specific Joke

This method returns a specific joke based on index in jokes.json

Parameters

index: Returns joke of the given index. Required

Example:

/jokes/20

Response

JSON Response of indexed joke

If index is given as 300:

Status: 200 OK { "joke": "Yo momma is like a bag of potato chips, 'Free-To-Lay.'" }

For invalid index parameter:

Status: 404 NOT FOUND { "detail": "Invalid index paramter" }

If you put query as “yo momma”:

Status: 200 OK { "results": "DONT" }

GET /search Search Jokes

This method returns jokes based on search query

Parameters

query: String query to search Required

Example:

/search?query=money

Response

JSON Response of indexed joke

If index is given as 300:

Status: 200 OK { "results": [ "Yo momma is so ugly that people at the circus pay money not to see her.", "Yo momma is so stupid that she sold her car for gas money!", "Yo momma is so poor Nigerian scammers wire HER money!", "Yo momma is so poor that burglars break in and leave money." ] }

If no query parameter given:

Status: 422 UNPROCESSABLE ENTITY { "detail":[{"loc":["query","query"], "msg":"field required", "type":"value_error.missing"}] }

Contribute

Contributors:

How to Contribute:

Since this is a small scale project, this is going to be simple.

For adding new features

  • Fork this project, Commit your features in a separate branch and make a Pull request.

To work on issues or bugs

  • Check out the issues and start contributing.

PS: Keep adding more Yo momma jokes and have fun!