Giter VIP home page Giter VIP logo

random-word-api's Introduction

Random word API

Endpoints

/all

Return all stored words. This will be a huge data dump and will take a long time to fetch and will probably slow down your application.

Example:
https://random-word-api.herokuapp.com/all

/word

Return one stored word randomly. Options can be further specified, see the parameters menu.

Example:
https://random-word-api.herokuapp.com/word

/languages

Return a list of stored language codes. Useful if you want a multilanguage app. See Github to find out how to add your own.

Example:
https://random-word-api.herokuapp.com/languages

Parameters

?number

Set number of requested words. If it exceeds the maximum stored amount, it will just return all of them.

Example:
https://random-word-api.herokuapp.com/word?number=10

?length

Set length of requested words. This will only return words that contain x amount of letters.

Example:
https://random-word-api.herokuapp.com/word?length=5

?lang

Set language of requested words. Go to Github to get more info on how to add your own language.

Currently supported languages:
https://random-word-api.herokuapp.com/languages
Example:
https://random-word-api.herokuapp.com/word?lang=es

Development

You will need scala and sbt

pacman -S scala sbt
sbt run

random-word-api's People

Contributors

ale-flash avatar ktevfik avatar razorsh4rk avatar sudocode1 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

random-word-api's Issues

No longer working

The following link returns this error
https://random-word-api.herokuapp.com/word?number=1&swear=0

	at Main$.getWord(Main.scala:111)
	at Main$.$anonfun$new$18(Main.scala:86)
	at cask.router.Result$Success.map(Result.scala:21)
	at cask.router.Result$Success.map(Result.scala:20)
	at Main$.$anonfun$new$10(Main.scala:86)
	at cask.router.EntryPoint.invoke(EntryPoint.scala:46)
	at cask.router.Decorator$.$anonfun$invoke$2(Decorators.scala:58)
	at cask.endpoints.WebEndpoint.wrapFunction(WebEndpoints.scala:14)
	at cask.endpoints.WebEndpoint.wrapFunction$(WebEndpoints.scala:12)
	at cask.endpoints.get.wrapFunction(WebEndpoints.scala:31)
	at cask.router.Decorator$.invoke(Decorators.scala:52)
	at cask.main.Main$DefaultHandler.handleRequest(Main.scala:99)
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)

Downtime

I think the API needs a good smack again to get it working

Possibly redesign website

Hey there,

The current website for this API is lacking in accessibility. The colour palette is kind of all over the place and I am unable to read the URLs of endpoints after I click them. I'm more than willing to help with this if you are interested. Also, thanks for creating such a valuable and free API :D

Add word length as a parameter

Hi, I think it would be nice to add a "lenght" paramenter to the requests in order to get words of size n

For example, if I try to make this request:

 https://random-word-api.herokuapp.com/word?number=1&lenght=5

I would get:

chair

Add Content-Length field to response header

The absence of a Content-Length field in the response header can cause some more strict libraries to fail to parse the response body.

See this issue where I encountered this problem in Odin. I have no experience with Scala or else I'd submit a PR instead.

API Key lifetime

Hello, does the API key has a 24 hours lifetime?
Yesterday I generated one API key to use in a bot project and it was working fine, but today I was getting "wrong API key" message as response.

Site returns 500 Internal Server Error

When accessing https://random-word-api.herokuapp.com/ it gives the following error message

java.lang.NoClassDefFoundError: Could not initialize class cask.package$
	at Main$.redir(Main.scala:48)
	at Main$.$anonfun$new$43(Main.scala:47)
	at cask.router.Result$Success.map(Result.scala:21)
	at cask.router.Result$Success.map(Result.scala:20)
	at Main$.$anonfun$new$42(Main.scala:47)
	at cask.router.EntryPoint.invoke(EntryPoint.scala:46)
	at cask.router.Decorator$.$anonfun$invoke$2(Decorators.scala:58)
	at cask.endpoints.WebEndpoint.wrapFunction(WebEndpoints.scala:14)
	at cask.endpoints.WebEndpoint.wrapFunction$(WebEndpoints.scala:12)
	at cask.endpoints.get.wrapFunction(WebEndpoints.scala:31)
	at cask.router.Decorator$.invoke(Decorators.scala:52)
	at cask.main.Main$DefaultHandler.handleRequest(Main.scala:99)
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)

API not working

I get this error when accessing the API

java.lang.NoClassDefFoundError: Could not initialize class cask.package$
	at Main$.redir(Main.scala:48)
	at Main$.$anonfun$new$43(Main.scala:47)
	at cask.router.Result$Success.map(Result.scala:21)
	at cask.router.Result$Success.map(Result.scala:20)
	at Main$.$anonfun$new$42(Main.scala:47)
	at cask.router.EntryPoint.invoke(EntryPoint.scala:46)
	at cask.router.Decorator$.$anonfun$invoke$2(Decorators.scala:58)
	at cask.endpoints.WebEndpoint.wrapFunction(WebEndpoints.scala:14)
	at cask.endpoints.WebEndpoint.wrapFunction$(WebEndpoints.scala:12)
	at cask.endpoints.get.wrapFunction(WebEndpoints.scala:31)
	at cask.router.Decorator$.invoke(Decorators.scala:52)
	at cask.main.Main$DefaultHandler.handleRequest(Main.scala:99)
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)

Unable to add parameters on "/all" endpoint

If I try to make a request (just going into the URL in my browser btw.) it won't accept params. Example URL: https://random-word-api.herokuapp.com/all?length=5

Example output:

Unknown argument: "length"

Arguments provided did not match expected signature:

getAll
  req  cask.Request
  lang  String (default en)

Just Wanted To Say Thanks

Thanks man, I just cloned your repo because I wanted to thank you for creating this EPIC api.
I was searhing for hours and there wasn't any api that provides this service for free....
Thanks once again.
:)

Sarthak

adding other languages

I was wondering if you'd be able to add other languages to your word generator, such as German and Dutch? (?lang=DE)...

Thanks and hello

I am currently using your API for a small project I am working on. But, I am working on hosting some version of it myself. Thank you very much. Please let me know if this is ok or if you want me to donate any money. Do you plan to continue to host it for a while? Also, I want to make sure to give you proper credit when/if I get around to hosting my own version. Thank you very much for all the work you've done on it!

so i may have taken down the entire site

ok so im not sure i should report this here or not but

i requested /all and it crashed the site completely
even /home isnt working. you should probably look into this

have a nice day:)

Thank you for this tool

Over the years, we've been using this api in many of our projects. It even became a running joke in our friendgroup to add word of the minute to as many things as possible, including:

A simple hats off and thanks for making this project, your work is appericiated!

Error "blocked by CORS"

Until yesterday it worked perfectly, today it gives me this error:

from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Add french language

Hello world, thanks you @RazorSh4rk for making this api available, I would like to be able to contribute to also add the French language, is it possible?

(pull request linked) improve the readme

  • explain how it works basically
  • explain how to use it
    i know this second bit is on the website but some people download the source and read the readme

ill probably work on this in a fork then pull request it over :)

EDIT: heres the pull request #9 :)

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.