Skip to content

Number Classification API is a serverless tool that checks number properties (prime, perfect, Armstrong) and fetches trivia via NumbersAPI, ensuring fast (<500ms) responses.

Notifications You must be signed in to change notification settings

elijahu1/numberapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 

Repository files navigation


Number Classification API ๐Ÿงฎ

A serverless API that analyzes numbers and returns their mathematical properties, powered by AWS Lambda and NumbersAPI.

Features โœจ

  • Number Classification: Checks if a number is prime, perfect, or Armstrong.
  • Fun Facts: Fetches interesting trivia from NumbersAPI.
  • Lightning Fast: Response time < 500ms.
  • CORS Ready: Works seamlessly with frontend apps.

Usage ๐Ÿš€

Endpoint

GET /api/classify-number?number=<integer>

Example Request

curl "https://7mu12vr223.execute-api.eu-west-1.amazonaws.com/dev/api/classify-number?number=371"

Example Response

{
    "number": 371,
    "is_prime": false,
    "is_perfect": false,
    "properties": ["armstrong", "odd"],
    "digit_sum": 11,
    "fun_fact": "371 is an Armstrong number because 3^3 + 7^3 + 1^3 = 371"
}

Tech Stack ๐Ÿ’ป

  • AWS Lambda: Serverless compute.
  • API Gateway: HTTP endpoint management.
  • Python 3.13: Backend logic.
  • NumbersAPI: Fun number facts.

Setup ๐Ÿ› ๏ธ

  1. Clone the repo:
    git clone https://github.com/elijahu1/numberapi.git
  2. Deploy to AWS:
    • Install AWS CLI and configure credentials.
    • Run deploy.sh to deploy the Lambda function and API Gateway.

Contributing ๐Ÿค

Feel free to open issues or submit PRs! Check out the contribution guide for details.

License ๐Ÿ“œ

MIT License. See LICENSE for details.


About

Number Classification API is a serverless tool that checks number properties (prime, perfect, Armstrong) and fetches trivia via NumbersAPI, ensuring fast (<500ms) responses.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published