pyairbnb


Namepyairbnb JSON
Version 0.0.0 PyPI version JSON
download
home_pagehttps://github.com/johnbalvin/pyairbnb
SummaryAirbnb scraper in Python
upload_time2024-11-04 20:39:23
maintainerNone
docs_urlNone
authorJohn (John Balvin)
requires_pythonNone
licenseNone
keywords airbnb scraper crawler bot reviews
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Airbnb scraper in Python

## Overview
This project is an open-source tool developed in Python for extracting product information from Airbnb. It's designed to be easy to use, making it an ideal solution for developers looking for Airbnb product data.

## Features
- Extract prices, available dates, reviews and others
- Full search support
- Extracts detailed product information from Airbnb
- Implemented in Python just because it's popular
- Easy to integrate with existing Python projects
- The code is optimize to work on this format: ```https://www.airbnb.com/rooms/[room_id]```

## Important
- With the new airbnb changes, if you want to get the price from a room url you need to specify the date range
the date range should be on the format year-month-day, if you leave the date range empty, you will get the details but not the price


### Install

```bash
$ pip install pyairbnb
```
## Examples

```Python
import pyairbnb
import json
currency="MXN"
check_in = "2025-02-01"
check_out = "2025-02-04"
ne_lat = -1.03866277790021
ne_long = -77.53091734683608
sw_lat = -1.1225978433925647
sw_long = -77.59713412765507
zoom_value = 2
search_results = pyairbnb.search_all(check_in,check_out,ne_lat,ne_long,sw_lat,sw_long,zoom_value, currency,"")
details_data = []
progress = 1
with open('search_results.json', 'w', encoding='utf-8') as f:
    f.write(json.dumps(search_results))
for result in search_results[:10]:
    data = pyairbnb.get_details_from_id(result["room_id"],currency,check_in,check_out,"")
    details_data.append(data)
    print("len results: ",progress, len(search_results))
    progress=progress+1

with open('details_data_json.json', 'w', encoding='utf-8') as f:
    f.write(json.dumps(details_data))
```

### Example for getting prices, avaiable dates, reviews and other metadata

### Getting the reviews, along with metadata
```Python
import pyairbnb
import json
room_url="https://www.airbnb.com/rooms/30931885"
data = pyairbnb.get_reviews(room_url,"")
with open('reviews.json', 'w', encoding='utf-8') as f:
    f.write(json.dumps(data["reviews"]))
```

### Getting just the available/unavailable dates
```Python
import pyairbnb
import json
room_url="https://www.airbnb.com/rooms/44590727"
calendar = pyairbnb.get_calendar(room_url,"")
with open('calendar.json', 'w', encoding='utf-8') as f:
    f.write(json.dumps(calendar["calendar"]))
```

### if you want to get the price you need to send the check in and check out date(this is a requirement on airbn itself)
```Python
import pyairbnb
import json
room_url="https://www.airbnb.com/rooms/43198150"
currency="USD"
check_in = "2025-01-02"
check_out = "2025-01-04"
data = pyairbnb.get_details_from_url(room_url,currency,check_in,check_out,"")
with open('details_data_json.json', 'w', encoding='utf-8') as f:
    f.write(json.dumps(data))
```


### example for getting details and NOT price
### if you won't want the price, you can just leave it empty
```Python
import pyairbnb
import json
room_url="https://www.airbnb.com/rooms/1029961446117217643"
currency="USD"
check_in = ""
check_out = ""
data = pyairbnb.get_details_from_url(room_url,currency,check_in,check_out,"")
with open('details_data_json.json', 'w', encoding='utf-8') as f:
    f.write(json.dumps(data))
```

```Python
import pyairbnb
import json
room_id=18039593#the room id
currency="MXN"
check_in = ""
check_out = ""
proxy_url = pyairbnb.parse_proxy("[IP or domain]","[port]","[user name]","[password]")
data = pyairbnb.get_details_from_id(room_id,currency,check_in,check_out,proxy_url)
with open('details_data_json.json', 'w', encoding='utf-8') as f:
    f.write(json.dumps(data))
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/johnbalvin/pyairbnb",
    "name": "pyairbnb",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "airbnb, scraper, crawler, bot, reviews",
    "author": "John (John Balvin)",
    "author_email": "John Balvin <johnchristian@hotmail.es>",
    "download_url": "https://files.pythonhosted.org/packages/d2/03/0d012d2f4838d9925faac0a013a7a20e07f79597bf7465540341c3b255ad/pyairbnb-0.0.0.tar.gz",
    "platform": null,
    "description": "# Airbnb scraper in Python\r\n\r\n## Overview\r\nThis project is an open-source tool developed in Python for extracting product information from Airbnb. It's designed to be easy to use, making it an ideal solution for developers looking for Airbnb product data.\r\n\r\n## Features\r\n- Extract prices, available dates, reviews and others\r\n- Full search support\r\n- Extracts detailed product information from Airbnb\r\n- Implemented in Python just because it's popular\r\n- Easy to integrate with existing Python projects\r\n- The code is optimize to work on this format: ```https://www.airbnb.com/rooms/[room_id]```\r\n\r\n## Important\r\n- With the new airbnb changes, if you want to get the price from a room url you need to specify the date range\r\nthe date range should be on the format year-month-day, if you leave the date range empty, you will get the details but not the price\r\n\r\n\r\n### Install\r\n\r\n```bash\r\n$ pip install pyairbnb\r\n```\r\n## Examples\r\n\r\n```Python\r\nimport pyairbnb\r\nimport json\r\ncurrency=\"MXN\"\r\ncheck_in = \"2025-02-01\"\r\ncheck_out = \"2025-02-04\"\r\nne_lat = -1.03866277790021\r\nne_long = -77.53091734683608\r\nsw_lat = -1.1225978433925647\r\nsw_long = -77.59713412765507\r\nzoom_value = 2\r\nsearch_results = pyairbnb.search_all(check_in,check_out,ne_lat,ne_long,sw_lat,sw_long,zoom_value, currency,\"\")\r\ndetails_data = []\r\nprogress = 1\r\nwith open('search_results.json', 'w', encoding='utf-8') as f:\r\n    f.write(json.dumps(search_results))\r\nfor result in search_results[:10]:\r\n    data = pyairbnb.get_details_from_id(result[\"room_id\"],currency,check_in,check_out,\"\")\r\n    details_data.append(data)\r\n    print(\"len results: \",progress, len(search_results))\r\n    progress=progress+1\r\n\r\nwith open('details_data_json.json', 'w', encoding='utf-8') as f:\r\n    f.write(json.dumps(details_data))\r\n```\r\n\r\n### Example for getting prices, avaiable dates, reviews and other metadata\r\n\r\n### Getting the reviews, along with metadata\r\n```Python\r\nimport pyairbnb\r\nimport json\r\nroom_url=\"https://www.airbnb.com/rooms/30931885\"\r\ndata = pyairbnb.get_reviews(room_url,\"\")\r\nwith open('reviews.json', 'w', encoding='utf-8') as f:\r\n    f.write(json.dumps(data[\"reviews\"]))\r\n```\r\n\r\n### Getting just the available/unavailable dates\r\n```Python\r\nimport pyairbnb\r\nimport json\r\nroom_url=\"https://www.airbnb.com/rooms/44590727\"\r\ncalendar = pyairbnb.get_calendar(room_url,\"\")\r\nwith open('calendar.json', 'w', encoding='utf-8') as f:\r\n    f.write(json.dumps(calendar[\"calendar\"]))\r\n```\r\n\r\n### if you want to get the price you need to send the check in and check out date(this is a requirement on airbn itself)\r\n```Python\r\nimport pyairbnb\r\nimport json\r\nroom_url=\"https://www.airbnb.com/rooms/43198150\"\r\ncurrency=\"USD\"\r\ncheck_in = \"2025-01-02\"\r\ncheck_out = \"2025-01-04\"\r\ndata = pyairbnb.get_details_from_url(room_url,currency,check_in,check_out,\"\")\r\nwith open('details_data_json.json', 'w', encoding='utf-8') as f:\r\n    f.write(json.dumps(data))\r\n```\r\n\r\n\r\n### example for getting details and NOT price\r\n### if you won't want the price, you can just leave it empty\r\n```Python\r\nimport pyairbnb\r\nimport json\r\nroom_url=\"https://www.airbnb.com/rooms/1029961446117217643\"\r\ncurrency=\"USD\"\r\ncheck_in = \"\"\r\ncheck_out = \"\"\r\ndata = pyairbnb.get_details_from_url(room_url,currency,check_in,check_out,\"\")\r\nwith open('details_data_json.json', 'w', encoding='utf-8') as f:\r\n    f.write(json.dumps(data))\r\n```\r\n\r\n```Python\r\nimport pyairbnb\r\nimport json\r\nroom_id=18039593#the room id\r\ncurrency=\"MXN\"\r\ncheck_in = \"\"\r\ncheck_out = \"\"\r\nproxy_url = pyairbnb.parse_proxy(\"[IP or domain]\",\"[port]\",\"[user name]\",\"[password]\")\r\ndata = pyairbnb.get_details_from_id(room_id,currency,check_in,check_out,proxy_url)\r\nwith open('details_data_json.json', 'w', encoding='utf-8') as f:\r\n    f.write(json.dumps(data))\r\n```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Airbnb scraper in Python",
    "version": "0.0.0",
    "project_urls": {
        "Homepage": "https://github.com/johnbalvin/pyairbnb"
    },
    "split_keywords": [
        "airbnb",
        " scraper",
        " crawler",
        " bot",
        " reviews"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1e33ea022e786c5b265aea483387936ccde1d0564f8d9824fde0cd59557d0532",
                "md5": "b685140ebd692d3fdfbf0469c258ad63",
                "sha256": "0c198e461c0de98ceac067dc72552bf794ecde4ea9b48529ee3da5abc17ce744"
            },
            "downloads": -1,
            "filename": "pyairbnb-0.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b685140ebd692d3fdfbf0469c258ad63",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 15987,
            "upload_time": "2024-11-04T20:39:21",
            "upload_time_iso_8601": "2024-11-04T20:39:21.910805Z",
            "url": "https://files.pythonhosted.org/packages/1e/33/ea022e786c5b265aea483387936ccde1d0564f8d9824fde0cd59557d0532/pyairbnb-0.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d2030d012d2f4838d9925faac0a013a7a20e07f79597bf7465540341c3b255ad",
                "md5": "46d2e8320a2c7bf0538fdbb553484e41",
                "sha256": "a269ee00eefaa9f04bbf311919c83c2d9d5f5b401c7e30972ff12db33a98bde1"
            },
            "downloads": -1,
            "filename": "pyairbnb-0.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "46d2e8320a2c7bf0538fdbb553484e41",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13071,
            "upload_time": "2024-11-04T20:39:23",
            "upload_time_iso_8601": "2024-11-04T20:39:23.605134Z",
            "url": "https://files.pythonhosted.org/packages/d2/03/0d012d2f4838d9925faac0a013a7a20e07f79597bf7465540341c3b255ad/pyairbnb-0.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-04 20:39:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "johnbalvin",
    "github_project": "pyairbnb",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyairbnb"
}
        
Elapsed time: 0.40139s