{"id":13455967,"url":"https://github.com/ParclLabs/parcllabs-python","last_synced_at":"2025-03-24T09:31:09.988Z","repository":{"id":236133376,"uuid":"784363961","full_name":"ParclLabs/parcllabs-python","owner":"ParclLabs","description":"Parcl Labs Python SDK","archived":false,"fork":false,"pushed_at":"2024-05-22T20:37:59.000Z","size":715,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-22T20:52:08.905Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.parcllabs.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ParclLabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-09T17:47:15.000Z","updated_at":"2024-05-31T00:02:42.624Z","dependencies_parsed_at":"2024-05-31T00:02:33.676Z","dependency_job_id":null,"html_url":"https://github.com/ParclLabs/parcllabs-python","commit_stats":null,"previous_names":["parcllabs/parcllabs-python"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParclLabs%2Fparcllabs-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParclLabs%2Fparcllabs-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParclLabs%2Fparcllabs-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParclLabs%2Fparcllabs-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ParclLabs","download_url":"https://codeload.github.com/ParclLabs/parcllabs-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245243222,"owners_count":20583585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T08:01:14.162Z","updated_at":"2025-03-24T09:31:09.977Z","avatar_url":"https://github.com/ParclLabs.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003c!-- readme header split --\u003e\n![Logo](img/labs.png)\n![GitHub Tag](https://img.shields.io/github/v/tag/ParclLabs/parcllabs-python)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/parcllabs)\n\u003c!-- readme header end --\u003e\n## **Welcome to the Parcl Labs Python SDK**\n\n**We're on a mission to create the world's best API developer experience and community for housing data.**\n\nOur SDK is designed to supercharge your API experience and accelerate your time to insight. It enables you to efficiently pull the data you need, analyze it, and visualize your findings.\n\n\u003c!-- readme header split --\u003e\n## Parcl Labs Data Overview\n\nThe Parcl Labs API provides **instant insights into the U.S. housing market**, delivering data on housing supply, sales, listings, rentals, investor activities, and market trends.\n\n\n\n_The most complete picture of US residential real estate_\n\n| Category           | Coverage                                                                                                                                                      |\n|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Property Types** | **🏘️ All Residential Assets:**\u003cbr\u003e✅ Single Family\u003cbr\u003e✅ Townhouses\u003cbr\u003e✅ Condos\u003cbr\u003e✅ Other                                                                      |\n| **Markets**        | **🇺🇸 Complete National Coverage, 70k+ Unique Markets at Any Level of Granularity:**\u003cbr\u003e✅ Regions\u003cbr\u003e✅ States\u003cbr\u003e✅ Metros\u003cbr\u003e✅ Cities\u003cbr\u003e✅ Counties\u003cbr\u003e✅ Towns\u003cbr\u003e✅ Zips\u003cbr\u003e✅ Census Places |\n| **Housing Events** | **🔄 The Full Property Lifecycle:**\u003cbr\u003e✅ Sales\u003cbr\u003e✅ For Sale Listings\u003cbr\u003e✅ Rentals                                                                              |\n\n\u003c!-- readme header end --\u003e\n### Cookbook\n\nWe maintain a repository of examples that demonstrate how to use the Parcl Labs API for analysis. You can find the examples in the [Parcl Labs Cookbook](https://github.com/parcllabs/parcllabs-cookbook)\n\n## Premium Users\nAre you a premium user? See the [premium features](#premium-features) section for more information on how to access premium features including:\n- Access all homes for Invitation Homes, American Homes 4 Rent, and other large investors\n- Access national, unit level data with full event cycles (rentals, listings, sales)\n- Access `turbo_mode` for faster data retrieval\n\n## Getting Started\n\n### Step 1. Sign Up for an API Key\n\nTo use the Parcl Labs API, you need an API key. To get an API key, sign up at [ParclLabs](https://dashboard.parcllabs.com/signup). In the subsequent examples, the API key is stored in the `PARCLLABS_API_KEY` environment variable.\n\n\n\n### Step 2. Installation\n\nYou can install the package via pip:\n\n```bash\npip install -U parcllabs\n```\n\n### Step 3. Usage\n\nThe `ParclLabsClient` class is the entry point to the Parcl Labs API. You can use the client to access methods that allow you to retrieve and analyze data from the Parcl Labs API. You'll need to pass in your API key when you create an instance of the `ParclLabsClient` class.\n\n```python\nimport os\n\nfrom parcllabs import ParclLabsClient\n\n\napi_key = os.getenv('PARCL_LABS_API_KEY')\nclient = ParclLabsClient(api_key)\n```\n\n#### Search\nSearch is your entry point into finding one or many of over 70,000 markets in the United States. You can search for markets by `name`, `state`, `region`, `fips`, or `zip code`. You can also search for markets by their unique `parcl_id`.\n\n##### Search Markets\n```python\n# get top 2 metros by population\nmarkets = client.search.markets.retrieve(\n        location_type='CBSA',\n        sort_by='TOTAL_POPULATION',\n        sort_order='DESC',\n        limit=2\n)\n# top 2 metros based on population. We will use these markets to query other services in the remainder of this readme\ntop_market_parcl_ids = markets['parcl_id'].tolist()\n# parcl_id country  geoid state_fips_code                                   name state_abbreviation region location_type  total_population  median_income  parcl_exchange_market  pricefeed_market  case_shiller_10_market  case_shiller_20_market\n#  2900187     USA  35620            None  New York-Newark-Jersey City, Ny-Nj-Pa               None   None          CBSA          19908595          93610                      0                 1                       1                       1\n#  2900078     USA  31080            None     Los Angeles-Long Beach-Anaheim, Ca               None   None          CBSA          13111917          89105                      0                 1                       1                       1\n```\n\n#### Services\n\nServices are the core of the Parcl Labs API. They provide access to a wide range of data and analytics on the housing market. The services are divided into the following categories: `Price Feeds`, `Rental Market Metrics`, `For Sale Market Metrics`, `Market Metrics`, `Investor Metrics`, `Portfolio Metrics` and `Property`.\n\n#### Rental Market Metrics\n\n##### Gross Yield\nGets the percent gross yield for a specified `parcl_id`. At the market level, identified by `parcl_id`, gross yield is calculated by dividing the annual median rental income—derived from multiplying the monthly median new rental listing price by 12—by its median new listings for sale price.\n\n##### Rental Units Concentration\nGets the number of rental units, total units, and percent rental unit concentration for a specified `parcl_id`.\n\n##### New Listings for Rent Rolling Counts\nGets weekly updated rolling counts of newly listed for rent properties, segmented into 7, 30, 60, and 90 day periods ending on a specified date, based on a given `parcl_id`.\n\n###### Get all rental market metrics\n```python\nstart_date = '2024-04-01'\nend_date = '2024-04-01'\n\nresults_rental_units_concentration = client.rental_market_metrics.rental_units_concentration.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n\nresults_gross_yield = client.rental_market_metrics.gross_yield.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n\nrentals_new_listings_rolling_counts = client.rental_market_metrics.new_listings_for_rent_rolling_counts.retrieve(\n        parcl_ids=top_market_parcl_ids\n)\n```\n\n#### For Sale Market Metrics\n\n##### New Listings Rolling Counts\nGets weekly updated rolling counts of newly listed for sale properties, segmented into 7, 30, 60, and 90 day periods ending on a specified date, based on a given `parcl_id`.\n\n##### For Sale Inventory\nGets the weekly updated current count of total inventory listed on market for sale, based on a specified `parcl_id` . The data series for the for sale inventory begins on September 1, 2022 (2022-09-01).\n\n##### For Sale Inventory Price Changes\nGets weekly updated metrics on the price behavior of current for sale inventory, based on a specified `parcl_id`. Available metrics include the count of price changes, count of price drops, median days between price changes, median price change, and the percentage of inventory with price changes. The data series for the for sale inventory metrics begins on September 1, 2022 (2022-09-01).\n\n###### Get all for sale market metrics\n```python\nstart_date = '2024-04-01'\nend_date = '2024-04-01'\nproperty_type = 'single_family'\n\nresults_for_sale_new_listings = client.for_sale_market_metrics.new_listings_rolling_counts.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date,\n    property_type=property_type\n)\n\nfor_sale_inventory = client.for_sale_market_metrics.for_sale_inventory.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n\nfor_sale_inventory_price_changes = client.for_sale_market_metrics.for_sale_inventory_price_changes.retrieve(\n        parcl_ids=top_market_parcl_ids,\n        start_date=start_date,\n        end_date=end_date,\n)\n```\n\n#### Market Metrics\n\n##### Housing Event Counts\nGets monthly counts of housing events, including sales, new sale listings, and new rental listings, based on a specified `parcl_id`.\n\n##### Housing Stock\nGets housing stock for a specified `parcl_id`. Housing stock represents the total number of properties, broken out by single family homes, townhouses, and condos.\n\n##### Housing Event Prices\nGets monthly statistics on prices for housing events, including sales, new for-sale listings, and new rental listings, based on a specified `parcl_id`.\n\n##### Housing Event Property Attributes\nGets monthly statistics on the physical attributes of properties involved in housing events, including sales, new for sale listings, and new rental listings, based on a specified `parcl_id`.\n\n##### All Cash\nGets monthly counts of all cash transactions and their percentage share of total sales, based on a specified `parcl_id`.\n\n\n###### Get all market metrics\n```python\nstart_date = '2024-01-01'\nend_date = '2024-04-01'\n\nresults_housing_event_prices = client.market_metrics.housing_event_prices.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n\nresults_housing_stock = client.market_metrics.housing_stock.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n\nresults_housing_event_counts = client.market_metrics.housing_event_counts.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n\nhousing_event_property_attributes = client.market_metrics.housing_event_property_attributes.retrieve(\n        parcl_ids=top_market_parcl_ids,\n        start_date=start_date,\n        end_date=end_date\n)\n\nresults_all_cash = client.market_metrics.all_cash.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n```\n\n#### New Construction Metrics\n\n##### Housing Event Counts\nGets monthly counts of new construction housing events, including sales, new for sale listings, and new rental listings, based on a specified `parcl_id`.\n\n##### Housing Event Prices\nGets monthly median prices for new construction housing events, including sales, new for sale listings, and new rental listings, based on a specified `parcl_id`.\n\n###### Get all new construction metrics\n```python\nstart_date = '2024-01-01'\nend_date = '2024-04-01'\n\nresults_new_construction_housing_event_prices = client.new_construction_metrics.housing_event_prices.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n\nresults_new_construction_housing_event_counts = client.new_construction_metrics.housing_event_counts.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n```\n\n#### Investor Metrics\n\n##### Housing Event Counts\nGets monthly counts of investor housing events, including acquisitions, dispositions, new sale listings, and new rental listings, based on a specified `parcl_id`.\n\n##### Purchase to Sale Ratio\nGets the monthly investor purchase to sale ratio for a specified `parcl_id`.\n\n##### New Listings for Sale Rolling Counts\nGets weekly updated rolling counts of investor-owned properties newly listed for sale, and their corresponding percentage share of the total for-sale listings market. These metrics are segmented into 7, 30, 60, and 90-day periods ending on a specified date, based on a given `parcl_id`\n\n##### Housing Stock Ownership\nGets counts of investor-owned properties and their corresponding percentage ownership share of the total housing stock, for a specified `parcl_id`.\n\n##### Housing Event Prices\nGets monthly median prices for investor housing events, including acquisitions, dispositions, new sale listings, and new rental listings, based on a specified `parcl_id`.\n\n###### Get all investor metrics\n```python\nstart_date = '2024-01-01'\nend_date = '2024-04-01'\n\nresults_housing_stock_ownership = client.investor_metrics.housing_stock_ownership.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n\nresults_new_listings_for_sale_rolling_counts = client.investor_metrics.new_listings_for_sale_rolling_counts.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n\nresults_purchase_to_sale_ratio = client.investor_metrics.purchase_to_sale_ratio.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n\nresults_housing_event_counts = client.investor_metrics.housing_event_counts.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n\nresults = client.investor_metrics.housing_event_prices.retrieve(\n        parcl_ids=top_market_parcl_ids,\n        start_date=start_date,\n        end_date=end_date,\n)\n```\n\n#### Portfolio Metrics\n\n##### Single Family Housing Event Counts\n\nGets monthly counts of investor-owned single family property housing events, segmented by portfolio size, for a specified `parcl_id`. Housing events include acquisitions, dispositions, new for sale listings, and new rental listings.\n\n##### Single Family Housing Stock Ownership\n\nGets counts of investor-owned single family properties and their corresponding percentage of the total single family housing stock, segmented by portfolio size, for a specified `parcl_id`. The data series for portfolio metrics begins on March 1, 2024 (2024-03-01).\n\n##### New Listings for Sale Rolling Counts\n\nGets counts of investor-owned single family properties and their corresponding percentage of the total single family housing stock, segmented by portfolio size, for a specified `parcl_id`. The data series for portfolio metrics begins on April 15, 2024 (2024-04-15).\n\n##### New Listings for Rent Rolling Counts\n\nGets weekly updated rolling counts of investor-owned single family properties newly listed for rent, segmented by portfolio size, and their corresponding percentage share of the total single family for rent listings market. These metrics are divided into 7, 30, 60, and 90 day periods ending on a specified date, based on a given `parcl_id`. The data series for portfolio metrics begins on April 22, 2024 (2024-04-22).\n\n```python\nresults_housing_stock_ownership = client.portfolio_metrics.sf_housing_stock_ownership.retrieve(\n    parcl_ids=top_market_parcl_ids,\n)\n\n# get new listings for specific portfolio sizes\nportfolio_metrics_new_listings = client.portfolio_metrics.sf_new_listings_for_sale_rolling_counts.retrieve(\n        parcl_ids=top_market_parcl_ids,\n        portfolio_size='PORTFOLIO_1000_PLUS',\n)\n\nresults = client.portfolio_metrics.sf_housing_event_counts.retrieve(\n    parcl_ids=top_market_parcl_ids,\n    portfolio_size='PORTFOLIO_1000_PLUS'\n)\n\nresults = client.portfolio_metrics.sf_new_listings_for_rent_rolling_counts.retrieve(\n        parcl_ids=top_market_parcl_ids,\n        portfolio_size='PORTFOLIO_1000_PLUS'\n)\n```\n\n#### Price Feeds\nThe Parcl Labs Price Feed (PLPF) is a daily-updated, real-time indicator of residential real estate prices, measured by price per square foot, across select US markets.\n\nThe Price Feeds category allows you to access our daily-updated PLPF and derivative metrics, such as volatility.\n\n##### Price Feed\nGets the daily price feed for a specified `parcl_id`.\n\n##### Price Feed Volatility\nGets the daily price feed volatility for a specified `parcl_id`.\n\n##### Rental Price Feed\nGets the daily updated Parcl Labs Rental Price Feed for a given `parcl_id`.\n\n```python\n# get 2 price feeds trading on the Parcl Exchange\npricefeed_markets = client.search.markets.retrieve(\n        sort_by='PARCL_EXCHANGE_MARKET', # use PRICEFEED_MARKET for all price feed markets\n        sort_order='DESC',\n        limit=2\n)\n# top 2 metros based on population. We will use these markets to query other services in the remainder of this readme\npricefeed_ids = pricefeed_markets['parcl_id'].tolist()\nstart_date = '2024-06-01'\nend_date = '2024-06-05'\n\nprice_feeds = client.price_feed.price_feed.retrieve(\n    parcl_ids=pricefeed_ids,\n    start_date=start_date,\n    end_date=end_date\n)\nrental_price_feeds = client.price_feed.rental_price_feed.retrieve(\n    parcl_ids=pricefeed_ids,\n    start_date=start_date,\n    end_date=end_date\n)\nprice_feed_volatility = client.price_feed.volatility.retrieve(\n    parcl_ids=pricefeed_ids,\n    start_date=start_date,\n    end_date=end_date\n)\n\n# want to save to csv? Use .to_csv method as follow:\n# price_feeds.to_csv('price_feeds.csv', index=False)\n# rental_price_feeds.to_csv('rental_price_feeds.csv', index=False)\n# price_feed_volatility.to_csv('price_feed_volatility.csv', index=False)\n```\n\n### Premium Features\nA premium Parcl Labs API key unlocks several critical features. This includes:\n- Access to our unit level, full event lifecycle data\n- Access to `turbo_mode` for faster data retrieval\n\nYou can register for a premium Parcl Labs API key through your [account dashboard](https://dashboard.parcllabs.com/).\n\n#### Property\n\n##### Property Search Markets\nGets a list of unique identifiers (parcl_property_id) for units that correspond to specific markets or parameters defined by the user. The parcl_property_id is key to navigating the Parcl Labs API, serving as the core mechanism for retrieving unit-level information.\n\n```python\n# search by operators\ninvitation_homes_tampa_units = client.property.search.retrieve(\n    parcl_ids=[2900417],\n    property_type='single_family',\n    # square_footage_min=1000,\n    # square_footage_max=2500,\n    # bedrooms_min=2,\n    # bedrooms_max=5,\n    # bathrooms_min=2,\n    # bathrooms_max=3,\n    # year_built_min=2010,\n    # year_built_max=2023,\n    current_entity_owner_name='invitation_homes',\n    # event_history_sale_flag=True,\n    # event_history_rental_flag=True,\n    # event_history_listing_flag=True,\n    # current_new_oncstruciton_flag=True,\n    # current_owner_occupied_flag=True,\n    # current_investor_owned_flag=True,\n)\n\n# search by buy box - only look at units that have rented\n# and review rental rates\nrental_buy_box = client.property.search.retrieve(\n    parcl_ids=[2900417],\n    property_type='single_family',\n    square_footage_min=1000,\n    square_footage_max=2500,\n    bedrooms_min=2,\n    bedrooms_max=5,\n    # bathrooms_min=2,\n    # bathrooms_max=3,\n    year_built_min=2010,\n    year_built_max=2023,\n    # current_entity_owner_name='invitation_homes',\n    # event_history_sale_flag=True,\n    event_history_rental_flag=True,\n    # event_history_listing_flag=True,\n    # current_new_oncstruciton_flag=True,\n    # current_owner_occupied_flag=True,\n    # current_investor_owned_flag=True,\n)\n\n# to extract parcl_property_id's to retrieve expanded history for \n# any of these queries, use: \nparcl_property_id_list = rental_buy_box['parcl_property_id'].tolist()\n```\n\n##### Property Event History\nGets unit-level properties and their housing event history, including sales, listings, and rentals. The response includes detailed property information and historical event data for each specified property.\n\n```python\nsale_events = client.property.events.retrieve(\n        parcl_property_ids=parcl_property_id_list[0:10],\n        event_type='SALE',\n        start_date='2020-01-01',\n        end_date='2024-06-30'\n)\n\nrental_events = client.property.events.retrieve(\n        parcl_property_ids=parcl_property_id_list[0:10],\n        event_type='RENTAL',\n        start_date='2020-01-01',\n        end_date='2024-06-30'\n)\n```\n\n\n#### Property Address Search \nPass in a list of addresses -- `address, unit, city, state_abbreviation, zip_code, source_id` -- and receive the associated `parcl_property_id`, if there is a match. `unit` and `source_id` are optional fields.\n\n```python\naddresses = client.property_address.search.retrieve(\n    addresses=[\n        {\n            \"address\": \"123 Main St\",\n            \"city\": \"New York\",\n            \"state_abbreviation\": \"NY\",\n            \"zip_code\": \"10001\",\n            \"source_id\": \"123\",\n        },\n        {\n            \"address\": \"6251 coldwater canyon ave\",\n            \"unit\": \"unit 311\",\n            \"city\": \"north hollywood\",\n            \"state_abbreviation\": \"CA\",\n            \"zip_code\": \"91606\",\n            \"source_id\": \"456\",\n        },\n    ]\n)\n```\n\n##### Turbo Mode\nTurbo mode is a premium feature that allows you to retrieve data faster. To enable turbo mode, set the `turbo_mode` parameter to `True` when creating an instance of the `ParclLabsClient` class.\n\n```python\nclient = ParclLabsClient(api_key, turbo_mode=True)\n```\n\nThis will enable turbo mode for all subsequent API calls which is a smart switch to route API calls through more efficient, premium endpoints designed for bulk data retrieval.\n\n\n##### Account Info\nMonitor your API usage and quota limits by calling the `account()` method in the `ParclLabsClient` class.\n```python\nclient = ParclLabsClient(api_key)\naccount_info = client.account()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FParclLabs%2Fparcllabs-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FParclLabs%2Fparcllabs-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FParclLabs%2Fparcllabs-python/lists"}