Download the PHP package inigo-aldama/inmovilla-api-client without Composer
On this page you can find all versions of the php package inigo-aldama/inmovilla-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download inigo-aldama/inmovilla-api-client
More information about inigo-aldama/inmovilla-api-client
Files in inigo-aldama/inmovilla-api-client
Package inmovilla-api-client
Short Description A PHP library to interact with the Inmovilla API
License MIT
Homepage https://github.com/inigo-aldama/inmovilla-api-client
Informations about the package inmovilla-api-client
Inmovilla API Client (Unofficial)
[]()
[
]()
inmovilla-api-client
is a PHP library that provides an interface for interacting with the Inmovilla real estate API. It simplifies requests, pagination, and data handling, allowing developers to focus on building applications.
Note: This project is not affiliated with, endorsed by, or maintained by Inmovilla.
Features
- API Configuration: Easy setup using
.ini
files or arrays. - Request Handling: Supports batch requests and flexible filtering.
- DTOs: Data transfer objects for working with API data in a structured way.
- Pagination: Handles paginated responses seamlessly.
- PSR Compliance: Built with PSR-7, PSR-11, and PSR-18 standards.
Requirements
- PHP: 7.4 or higher.
- Composer: For dependency management.
- Required PHP extensions:
ext-json
ext-curl
Installation
Install the package using Composer:
Configuration
Using an .ini
File
Create a configuration file (e.g., config/api.ini
) with the following content:
Load the configuration with:
Using an Array
Alternatively, use an array for configuration:
Example: Complete Flow
This example demonstrates how to retrieve cities, their zones, and properties associated with those zones, as well as fetch detailed property information.
Extending a Repository
To add custom functionality to a repository, you can extend the base class and implement your own methods. Here’s an example of adding a method to fetch properties with an elevator:
Example Usage
Using the API Client Directly
If you want to bypass the repositories, you can use the API client directly to make custom requests:
DTOs (Data Transfer Objects)
The library uses DTOs (Data Transfer Objects) to map API responses to structured PHP objects. Below are the key DTOs and their purposes:
General DTOs
CiudadDTO
: Represents a city.ZonaDTO
: Represents a zone within a city.
Property DTOs
PropiedadDTO
: Represents a property in a property listing.PropiedadFichaDTO
: Represents detailed information about a specific property. This is retrieved when querying property details using its offer code.
Pagination DTOs
PaginacionPropiedadesDTO
: Handles paginated property listings.PaginacionCiudadesDTO
: Handles paginated city data.PaginacionZonasDTO
: Handles paginated zone data.PaginacionDestacadosDTO
: Handles paginated "featured" properties.
Testing
Run PHPUnit tests to validate functionality:
Contribution
- Fork the repository.
- Create a new branch (
git checkout -b feature/new-feature
). - Commit your changes (
git commit -m 'Add new feature'
). - Push to your branch (
git push origin feature/new-feature
). - Open a pull request.
License
This project is licensed under the MIT License.
Credits
- Author: Iñigo Aldama Gómez
- Repository: inmovilla-api-client
All versions of inmovilla-api-client with dependencies
ext-json Version *
ext-curl Version *
guzzlehttp/guzzle Version ^7.9
php-http/discovery Version ^1.20
php-http/message Version ^1.16