Giter VIP home page Giter VIP logo

bored-api's Introduction

Bored API

A free and simple API to help you find something better to do

Bored API Website

About

This project is an MEVN (MongoDB, Express.js, Vue.js, and Node.js) web app that has a goal of creating a simple way to find things to do. You do not need an API key to use this API, just query the endpoint to get data. All activities served by the API can be found here.


Endpoints

The full documentation can be found here, but listed below are a few of the endpoints.

Random event

Gets a random event

/api/activity/

Response:

{
  "activity": "Learn Express.js",
  "accessibility": 0.25,
  "type": "education",
  "participants": 1,
  "price": 0.1,
  "link": "https://expressjs.com/",
  "key": "3943506"
}

Get by type

Query for events by a certain type

/api/activity?type=:type

Response:

{
  "activity": "Learn how to play a new sport",
  "accessibility": 0.2,
  "type": "sports",
  "participants": 1,
  "price": 0.1,
  "key": "5808228"
}

Using

To set up your own Bored API, clone the app, start your MongoDB instance, and run:

npm install
npm start
# Started on port 8080

Contributing

All help is welcome! A pull request or a new issue would be very appreciated. If you want to add more activities, I've created a UI on the website to make suggesting easy.


Usage

The Bored API has been used in many other applications and projects:

bored-api's People

Contributors

commandertvis avatar dependabot[bot] avatar drewthoennes avatar emilsgulbis avatar perlkonig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bored-api's Issues

How to use it?

Im trying to figure out how to use this at all because I can't seem to figure it out

GRPC APIs

Hi,
Any plans for creating GRPC APIs for the same ?

cors/url error

Hi! Thanks for api, but I tried to use it and was getting CORS errors, finally figured out that instead of http://boredapi.com/api/activity/ i should use https://www.boredapi.com/api/activity/, that is with www part.
Maybe change example or server settings. I can elaborate if needed, with screenshots or code.

Add fields to the endpoint

Is there a way to get more fields like kidFriendly and duration? or do these need to be added to the API still?

HTTPS Requests Not Working (Expired Certificate)

It looks like the Let's Encrypt certificate expired yesterday so HTTPS requests have issues:

Issued To:
Common Name (CN)	www.boredapi.com
Organization (O)	<Not Part Of Certificate>
Organizational Unit (OU)	<Not Part Of Certificate>

Issued By:
Common Name (CN)	R3
Organization (O)	Let's Encrypt
Organizational Unit (OU)	<Not Part Of Certificate>

Validity Period:
Issued On	Tuesday, March 1, 2022 at 5:24:42 PM
Expires On	Monday, May 30, 2022 at 6:24:41 PM

Fingerprints:
SHA-256 Fingerprint	4F 09 0A 4B B3 83 EF CD 48 92 80 15 9E 21 25 B3
04 B5 54 A3 F1 06 52 BA 99 F1 0E B0 36 13 DD 40
SHA-1 Fingerprint	7C E2 08 BC 40 8D 14 9E E1 9D 00 C6 BD 18 47 30
BA 53 A0 67

We're seeing this issue in Python apps where I work.

To reproduce, this fails:

from urllib.request import urlopen

API_URL = "https://www.boredapi.com/api/activity"

with urlopen(API_URL) as response:
    result = response.read()
    print(result)

With this traceback:

Traceback (most recent call last):
  File "/opt/Python-3.10.3/Lib/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/opt/Python-3.10.3/Lib/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/opt/Python-3.10.3/Lib/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/opt/Python-3.10.3/Lib/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/Python-3.10.3/Lib/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/opt/Python-3.10.3/Lib/http/client.py", line 975, in send
    self.connect()
  File "/opt/Python-3.10.3/Lib/http/client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/opt/Python-3.10.3/Lib/ssl.py", line 512, in wrap_socket
    return self.sslsocket_class._create(
  File "/opt/Python-3.10.3/Lib/ssl.py", line 1070, in _create
    self.do_handshake()
  File "/opt/Python-3.10.3/Lib/ssl.py", line 1341, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/daniel/junk/cert/main.py", line 5, in <module>
    with urlopen(API_URL) as response:
  File "/opt/Python-3.10.3/Lib/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/Python-3.10.3/Lib/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/opt/Python-3.10.3/Lib/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/opt/Python-3.10.3/Lib/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/opt/Python-3.10.3/Lib/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/opt/Python-3.10.3/Lib/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:997)>

It works fine if you change https to http in the URL though:

from urllib.request import urlopen

API_URL = "http://www.boredapi.com/api/activity"

with urlopen(API_URL) as response:
    result = response.read()
    print(result)
b'{"activity":"Write a short story","type":"recreational","participants":1,"price":0,"link":"","key":"6301585","accessibility":0.1}'

File not found error

In About section of README, path is given for activities.json file. But there is no such file exist with name activities.json.

Tasks are too Huge

The tasks that your API provides are too huge, I don't know how to access your database otherwise I would have added some simple tasks in there myself. There should be tasks that seem doable to the user like "hey you go touch some grass" or "hey you go take your dog for a walk"

Fetch API from a form

I am trying to have my users access the API using the input such as type, keywords or participants. Using your API how could I access certain activities using responses in a form?

The link in the readme.md is broken

The readme contains an about section as follow:

This project is an MEVN (MongoDB, Express.js, Vue.js, and Node.js) web app that has a goal of creating a simple way to find things to do. You do not need an API key to use this API, just query the endpoint to get data. All activities served by the API can be found here.

However, the link is dead. The here leads to a 404 page.
I'm not sure what the correct link is but it would be a simple fix. If someone provides me the link I can make a pr with the fix.

v2 suggestions

If you ever do want to update the API, then here are some new fields to consider to make the search more granular.

  • duration: A measure of how long an activity takes. Could be text or integer, but it should be discrete: minutes, hours, days, weeks.

  • accessibility: Redefined to focus on disability/health/age. At the very least, no challenges, minor challenges, major challenges.

  • resources or availability etc.: The former "accessibility" field but now focused on the resources needed to accomplish the task: no specialized resources needed, some easy-to-find resources needed, some specialized resources needed, very specialized equipment required.

  • kidfriendly: A simple boolean flag would do.

It would also be nice to allow for multiple "types" and to revisit the type taxonomy, maybe adding some hierarchy.

accessibility range parameter names error

Hi, I noticed that the range parameter names for accessibility are wrong way around.
It conflicts with the statements in the documentation that zero is MOST accessible."

"accessibility
A factor describing how possible an event is to do with zero being the most accessible
[0.0, 1.0]"

You can check it when using only 1 of the range parameters.
"MAXaccessibility"is actually the MINIMUM value up until zero (0).
and "MINaccessibility"is actually the MAXIMUM value up from one (1).

You wouldn't notice this when using both MINaccessibility and MAXaccessibility in one request, because then they are interchangeable.

Please ccorrect this issue.
(And notify my, because I now changed my frond-end to work with the reversed order)

Thanks.

Rate limiting?

Hi there,

I don't see any mention of rate-limiting in the docs. I was wondering what the story is if I want to use the API in an app. Let's say there are like, 100 - 200 requests total a day from my users, would that be ok for you? I can't imagine that you could just absorb an unlimited amount of requests per day.

Please let me know how much a day is too much, so I can adjust my code and plans accordingly. ๐Ÿ˜„

Increment the activities json

Hello,

Is the activities json still being updated regularly ? I've submitted few suggestions to increment it but seems to not be there.
I am keen to help and review all the received suggestions if necessary.
Just give me instructions how to proceed.

Participants more than 1

Cool API! Not really an issue i think but is it possible to set the participants on more than 1?

Somehting like: ?participants>1

"Endpoint not found Error"

Hello, when I try to test this Get in Postman, I get an error: endpoint not found result for just about every entry I try. Is this API still running?

License?

Hello, I was wondering what the license for this database is? If I include it in my own project so it can work offline, is that allowed, what's the deal with attribution, etc.

Please let me know, thanks!

Endpoint to all activities?

Hey, I was just wondering if there is an endpoint to all of the activities in the database? I am trying to access all of them at once to then manipulate the data myself for a school project. Let me know if that endpoint exists. Thanks!

API Usage on iOS App

I have a quick question, I am using the api on an application which I want to share on the App Store.
Now Apple requires us to provide information on wether this application show or makes use of third-party content and if yes we need to have the rights to do so.
Is there any website or document that I should mention so Apple knows I have the necessary rights?
Thanks

MongoError

API stopped working
Throwing a MongoError

[Question] Are keys intentionally returned as strings?

Looking at this sample output when requesting https://www.boredapi.com/api/activity:

{
"activity":"Go to a concert with some friends",
"accessibility":0.4,
"type":"social",
"participants":4,
"price":0.6,
"key":"4558850"
}

Most of the numeric data is being returned as numbers, like price and participants. But key field on an Activity is a string. Is this intentional? Is it safe to assume that this string contains only numbers and so can be stored in a big unsigned integer?

Thank you.

Accessibility and Price Questions

It would be helpful if your continuums were bounded on both ends.

If accessibility 0 is "most accessible", is 1 "impossible"? This is really challenging to mentally parse. What is a 0.5 as opposed to a 0.6, for example? What precisely do you mean by "accessible"? Often this refers to people with disabilities. Is that the intent here?

If price 0 is "free", what is 1? "Prohibitively expensive"? Again, what's the difference between 0.5 and 0.6?

Price

  • One approach is a subjective scale like 0 (free), 1 (trivial cost), 2 (minor cost), 3 (major cost)
  • Another is to turn it into an actual estimate of dollar price. Again, 0 is free, but maybe "Go to a movie with friends" might become 30 or whatever it might reasonably cost for one person to go to the movie and get popcorn.
  • Or, if you want to keep the 0-1 range, you could say that 1 = >$100 or >$1000 and then you scale the cost based on that.

Accessibility

  • If this is meant to refer to disability or age, then a finite integer scale is probably simplest: 0 (easy for almost everyone), 1 (may pose minor challenges to someone with a disability or elderly), 2 (definitely pose some challenge to someone with a disability or elderly), 3 (very difficult for someone with a disability or elderly)

Still subjective, but if documented, would be more useful than the 0-1 scale.

Anyway, just some ideas.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.