Get started
This guide will walk you through making your first API calls to the Inmobiliaria API. You’ll learn how to check the server health, fetch property listings, and authenticate requests.Before you begin, make sure you have the API server running. See the Installation guide if you need help setting up the development environment.
Quick health check
Start by verifying that the API server is running and healthy.Fetch property listings
Now let’s retrieve some property data from the API.Filter and search properties
Use query parameters to find specific properties:Common query parameters:
query- Text search across title and locationpropertyType- Filter by type (e.g.,departamento,casa,local)listingType- Filter by operation (e.g.,venta,alquiler)minPrice/maxPrice- Price range filterbedrooms/bathrooms- Minimum number of roomslocation- Search by city, province, or neighborhoodpage- Page number (default: 1)limit- Results per page (default: 10)
Authentication
Some endpoints require authentication. The API uses session-based authentication with HTTP-only cookies.Understand authentication
The Inmobiliaria API uses Better Auth for authentication. Session cookies are automatically sent with requests when using a browser or properly configured HTTP client.Authentication levels:
- Public endpoints - No authentication required (e.g., GET
/api/properties) - User endpoints - Requires any authenticated user (e.g., GET
/api/users/profile) - Admin endpoints - Requires admin role (e.g., POST
/api/properties)
All Better Auth endpoints are available at
/api/auth/*. This includes sign in, sign up, and OAuth flows.Check your session
Verify if you have an active session:Response with active session:Response without session:
Handle authentication errors
The API returns specific error responses for authentication failures:401 Unauthorized - No valid session:403 Forbidden - Valid session but insufficient permissions:See the Authentication guide for complete details on the auth flow.
Response format
All API responses follow a consistent structure: Successful response:Next steps
Now that you’ve made your first API calls, explore these resources to build more advanced integrations:API Reference
Explore all available endpoints and their parameters
Authentication Guide
Learn about sign up, sign in, and OAuth flows
Installation Guide
Set up your own development environment
Property Images
Learn how to upload and manage property images