Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vitormattos/api-zap
Api to collect data from ZapImoveis
https://github.com/vitormattos/api-zap
api php php8 realstate realstates scraper zapimoveis
Last synced: 3 months ago
JSON representation
Api to collect data from ZapImoveis
- Host: GitHub
- URL: https://github.com/vitormattos/api-zap
- Owner: vitormattos
- License: agpl-3.0
- Created: 2022-05-31T11:31:42.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-22T02:31:11.000Z (6 months ago)
- Last Synced: 2024-10-10T19:13:31.304Z (3 months ago)
- Topics: api, php, php8, realstate, realstates, scraper, zapimoveis
- Language: PHP
- Homepage:
- Size: 206 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# API REST to collect ZapImoveis data
Simple REST API to colect ZapImoveis data
## Install
```
cp .env.example .env
docker compose up -d
docker compose exec api composer install
docker compose exec api vendor/bin/phinx migrage
```## Endpoints
/api/zap-search### Query string
* Open developer tools of your browzer
* Do a search in ZapImoveis.
* Filter on Network tap by `/listing`
* Identify the last `GET` request
* Use the same as a query string## Analize collected data
```sql
select u.zap_id,
u.title,
u.bedrooms,
u.bathrooms,
u.total_areas,
ut."type",
p.price,
p.yearly_iptu,
p.monthly_condo_fee,
p.monthly_rental_total_price as total,
a.street,
a.neighborhood,
concat('https://www.zapimoveis.com.br/imovel/', u.zap_id) as url
from unit u
join prices p on p.zap_id = u.zap_id
join unit_type ut on ut.zap_id = u.zap_id
join address a on a.zap_id = u.zap_id
where business_type in ('RENTAL')
and u.zap_id not in ('2559137018')
and ut.type not in ('OFFICE', 'COMMERCIAL_BUILDING', 'COMMERCIAL_PROPERTY', 'BUSINESS', 'PARKING_SPACE', 'SHED_DEPOSIT_WAREHOUSE')
and a.street not in ('Rua dos Bobos')
and (u.bedrooms >= 2 or u.bedrooms is null)
and (u.total_areas >= 80 or u.total_areas is null)
-- and a.neighborhood in ('')
order by p.monthly_rental_total_price
```