Quickstart
The base URL for the Marvelly REST API is: https://api.marvelly.com.ng/v1
Configure Base URL
Depending on your environment and application, you will set the base URL differently. Below is a universal string that you can use to access our API. Copy it or return here later when you are ready with your environment or app.
Copy
https://api.marvelly.com.ng/v1The REST API does not support both versioned URLs in your API requests. You can use only one of the following formats:
Using the main URLs can help ensure compatibility with future updates and changes to the API. It is recommended to use the base URLs for long-term projects to maintain stability.
Making Your First API Call
Based on your environment, you will call our API differently. Below are two common ways to call our API using two popular programming languages: PHP, Python and NodeJS.
Notes
Some
GETrequest examples displayed throughout these docs are written for use with Node.js - theaxioslibrary may be required.Some
GETrequest examples displayed throughout these docs are written for use with Python - therequestlibrary may be required.
Making Your First API Call
Based on your environment, you will call our API differently. Below are three common ways to call our API using two popular programming languages: PHP, Python and NodeJS.
Example in Python
Let's start from very beginning. We assume you already installed Python (with venv), if not, here a guide for the beginners.
Create a new folder for test project, name it as aimlapi-welcome and change to it.
Copy
(Optional) If you use IDE then we recommend to open created folder as workspace. On example, in VSCode you can do it with:
Copy
Run a terminal inside created folder and create virtual envorinment with a command
Copy
Activate created virtual environment
Copy
Create new file and name it as api.py
Copy
Paste following content inside this travel.py and replace my_key with your API key you got on first step
Copy
Run the application
Copy
If you done all correct, you will see following output:
Copy
Example in NodeJS
As in the example from Python, we start from the very beginning too. We assume you already have Node.js installed. If not, here is a guide for beginners.
We need to create a new folder for the example project:
Copy
(Optional) If you use IDE then we recommend to open created folder as workspace. On example, in VSCode you can do it with:
Copy
Now create a project file:
Copy
Install the required dependencies:
Copy
Create a file with the source code:
Copy
And paste the following content:
Copy
You will see a response that looks like this:
Copy
Last updated