This repository contains a set of example APIs built with the Laravel framework, designed for use in the Software Developer study program at Curio. The APIs return JSON-only responses (no front-end) and serve as a hands-on learning tool for understanding API development in Laravel.
The project includes the following example endpoints:
-
GET
/weer/{country}/{city}-
Returns simulated weather data for a given country and city.
-
Example:
GET /weer/NL/Amsterdam
Response:
{ "country": "NL", "city": "Amsterdam", "Temp": 12, "RainChance": 73 }
-
-
GET
/currencyconverter/{from}/{to}/{amount}-
Converts an amount from one currency to another using predefined rates.
-
Example:
GET /currencyconverter/EUR/USD/100
Response:
{ "from": "EUR", "to": "USD", "amount": 100, "rate": 1.25, "calculated": 125 }
-
-
GET
/currencyconverter- Returns a list of available currencies and possible conversion pairs.
-
GET
/quote-
Returns a random inspirational quote.
-
Example Response:
{ "quote": "It always seems impossible until it’s done.", "author": "Nelson Mandela" }
-
Follow these steps to get the project running locally:
-
Clone the repository
git clone https://https://github.com/curio-team/native-api cd native-api -
Install PHP dependencies
composer install
-
Copy the example environment file
cp .env.example .env
-
Generate application key
php artisan key:generate
-
Start the development server
php artisan serve
The application will be available at:
http://127.0.0.1:8000
🚫 Note: This project does not include any frontend. So no need to run npm install. Additionally it has no database setup.
Use a tool like Postman, Insomnia, or simply your browser (for GET routes) to test the endpoints:
http://127.0.0.1:8000/weer/NL/Amsterdamhttp://127.0.0.1:8000/currencyconverter/EUR/USD/100http://127.0.0.1:8000/quote
This project is intended to help students:
- Understand how to define routes in Laravel.
- Work with controllers and structured responses.
- Explore error handling (e.g., invalid inputs).
- Gain hands-on practice with REST API development.