Skip to content

Anagram API RESTful Node.js based Multilingual (Italian, Spanish, English) is a free, open source anagram api to get all anagrams from a word or a group of letter.

License

Notifications You must be signed in to change notification settings

gpalleschi/anagram_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

anagram_api

Anagram API RESTful Node.js based Multilingual (English, Italian and Spanish) is a free, open source anagram api to get all anagrams from a word or a group of letter. The search id done on dictionaries on sqlite3 db. Api is superfast and extensible with another language.

API Reference


Languages

GET /languages

Return all languages managed.

Body

None

Response

{
    languages: array<String>
}

Examples

http://localhost:35907/languages

Response :  

{
	"languages": ["it",
	              "en",
		      "es"]
}


Anagram

Body

{
	languages: string,
	word: string
}

Response

{
    language: string,
    word: string,
    anagrams: array<String>

}

Examples

http://localhost:35907/anagram

Body : 

{
	"languages": "en",
	"word": "AEKST"
}

Response :

{
	"language":"en",
	"word":"AEKST",
	"anagrams":["KEATS",
	            "SKATE",
		    "STAKE",
		    "STEAK",
		    "TAKES"]
}

Error Managment

Error Response

{
    // Language code
    error: number,
    // Description error
    description: string
}

DB Reference

Dictionaries are loaded on sqlite3 DB in a single table named dictionaries :

Column Name Type Description Mandatory
id Integer Incremental key Yes
word text String in uppercase format represent the word Yes
language text Language code [en, es or it] Yes
length integer Word number of characters Yes
word_code text Word index generated with the sum of integer value of each unicode character of the word Yes

Prerequisites

  • Node v19.3.0 or upper
  • npm v9.2.0 or upper

Built With

NPM Modules

npm install

Run

npm start

Authors

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE 3.0 License - see the LICENSE file for details

About

Anagram API RESTful Node.js based Multilingual (Italian, Spanish, English) is a free, open source anagram api to get all anagrams from a word or a group of letter.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published