Comprehensive API for managing users, listings, and location-based searches
Enter your API key below to test all endpoints. You can use one of the demo keys or your own custom key.
https://api.directionvr.com/api.php
Try fetching the available categories using your configured API key:
curl -X GET "https://api.directionvr.com/api.php/categories" \
-H "X-API-Key: your_api_key_here"
All API requests require authentication using an API key. Include your API key in the request header:
X-API-Key: your_api_key_here
Alternative methods:
Authorization: Bearer your_api_key_here?api_key=your_api_key_here (for testing only)/users
Retrieve all users with pagination support.
page (optional) - Page number (default: 1)limit (optional) - Items per page (default: 20, max: 100){
"status": 200,
"message": "Success",
"data": {
"users": [
{
"id": 1,
"email": "[email protected]",
"name": "John Doe",
"phone": "+1234567890",
"creationdate": "2024-01-01 12:00:00",
"lastactivity": "2024-01-15 10:30:00",
"lastip": "192.168.1.1",
"lang": "en",
"rank": "user"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"pages": 8
}
},
"timestamp": "2024-01-15 10:30:00"
}
/users/{id}
Retrieve a specific user by ID.
{
"status": 200,
"message": "Success",
"data": {
"id": 1,
"email": "[email protected]",
"name": "John Doe",
"phone": "+1234567890",
"creationdate": "2024-01-01 12:00:00",
"lastactivity": "2024-01-15 10:30:00",
"lastip": "192.168.1.1",
"lang": "en",
"rank": "user"
},
"timestamp": "2024-01-15 10:30:00"
}
/users
Create a new user account.
email - User's email addresspassword - User's passwordname - User's full namephone - User's phone number{
"email": "[email protected]",
"password": "securepassword123",
"name": "Jane Smith",
"phone": "+1987654321"
}
/listings
Retrieve all active listings with pagination and filtering.
page (optional) - Page numberlimit (optional) - Items per page/listings
Create a new listing.
title - Listing titledescription - Listing descriptionlat, lng - Coordinatesphone, phone2, tollfree - Contact numbersemail, website - Contact infoaddress - Physical addressfacebook, twitter, instagram - Social mediaaid - Account ID (owner of the listing)/search/name
Search listings by name/title.
q - Search query/search/combined
Search listings by both name and address. When you search for "Gatineau", it will find listings where either the name contains "Gatineau" OR the address contains "Gatineau".
q - Search query (searches both name and address fields){
"status": 200,
"message": "Success",
"data": {
"results": [
{
"id": 123,
"title": "Restaurant Gatineau",
"address": "123 Main St, Gatineau, QC",
"description": "Great local restaurant...",
"lat": 45.4765,
"lng": -75.7013,
"phone": "+1-819-555-0123"
}
],
"search_type": "combined",
"query": "Gatineau",
"searched_fields": ["title", "address"],
"count": 5
}
}
/search/id
Find a specific listing by its exact ID number.
id - Listing ID (must be a valid number){
"status": 200,
"message": "Success",
"data": {
"result": {
"id": 123,
"title": "Restaurant Example",
"address": "123 Main St, City, Province",
"description": "Great local restaurant...",
"lat": 45.4765,
"lng": -75.7013,
"phone": "+1-819-555-0123"
},
"search_type": "id",
"id": "123",
"found": true
}
}
{
"status": 404,
"message": "Listing not found",
"data": {
"result": null,
"search_type": "id",
"id": "999999",
"found": false
}
}
/search/location
Search listings within a radius of given coordinates.
lat - Latitudelng - Longituderadius (optional) - Search radius in kilometers (default: 10)/search/zone
Search listings within predefined zones.
lat - Latitudelng - Longitudezone - Zone type: neighborhood (2km), city (10km), region (50km), province (200km)/categories
Get all available categories and subcategories.
include_subcategories (optional) - Include subcategories in response/visits
Record a visit to a listing and update the visit count. This endpoint tracks when someone views a listing and automatically increments the visit counter.
listing_id - The ID of the listing being visitedlat - Latitude of the visitor's locationlng - Longitude of the visitor's locationlang - Language preference ('fr' or 'en'){
"listing_id": 123,
"lat": "45.4925",
"lng": "-75.6305",
"lang": "fr"
}
{
"status": 201,
"message": "Visit recorded successfully",
"data": {
"listing_id": 123,
"visit_recorded": true,
"timestamp": "2024-01-15 14:30:25"
}
}
/visits
Get visit statistics for a specific listing, including the total visit count and number of visit records.
listing_id - The ID of the listing to get statistics for{
"status": 200,
"message": "Success",
"data": {
"id": 123,
"title": "Restaurant Example",
"visits": 45,
"visit_records": 42
}
}
/login
Authenticate a user with email and password to receive a JWT token for accessing user-specific endpoints.
email - User's email addresspassword - User's password{
"email": "[email protected]",
"password": "userpassword123"
}
{
"status": 200,
"message": "Login successful",
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"expires_at": "2024-01-16 14:30:25",
"user": {
"id": 1,
"email": "[email protected]",
"name": "John Doe",
"rank": "user"
}
}
}
/user/profile
Get the current user's profile information using JWT authentication.
Authorization: Bearer YOUR_JWT_TOKENX-Auth-Token: YOUR_JWT_TOKEN/user/comments
Add a comment to a listing (requires authentication).
listing_id - The ID of the listing to comment oncomment - The comment text/user/favorites
Add a listing to user's favorites (requires authentication).
listing_id - The ID of the listing to favorite/user/logout
Logout and invalidate the current JWT token.
| Status Code | Description | Common Causes |
|---|---|---|
| 200 | Success | Request completed successfully |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request data, missing required fields |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient permissions for this action |
| 404 | Not Found | Resource not found or invalid endpoint |
| 405 | Method Not Allowed | HTTP method not supported for this endpoint |
| 409 | Conflict | Resource already exists (e.g., duplicate email) |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server-side error, database connection issues |