### Install Investiny Package Source: https://github.com/alvarobartt/investiny/blob/main/docs/installation.md Installs the Investiny Python package from PyPI using pip. This is the primary method for adding the library to your Python environment. ```console $ pip install investiny ``` -------------------------------- ### Retrieve Historical Data Source: https://github.com/alvarobartt/investiny/blob/main/docs/usage.md Fetches historical data for a given asset from Investing.com using its Investing.com ID. Requires the asset's ID, a start date, and an end date. ```Python from investiny import historical_data data = historical_data(investing_id=6408, from_date="09/01/2022", to_date="10/01/2022") # Returns AAPL historical data as JSON (without date) ``` -------------------------------- ### Combined Asset Search and Data Retrieval Source: https://github.com/alvarobartt/investiny/blob/main/docs/usage.md Demonstrates the combined usage of search_assets and historical_data. First, it searches for an asset (e.g., AAPL), extracts its Investing.com ID, and then uses that ID to retrieve historical data. ```Python from investiny import historical_data, search_assets search_results = search_assets(query="AAPL", limit=1, type="Stock", exchange="NASDAQ") investing_id = int(search_results[0]["ticker"]) # Assuming the first entry is the desired one (top result in Investing.com) data = historical_data(investing_id=investing_id, from_date="09/01/2022", to_date="10/01/2022") ``` -------------------------------- ### Retrieve Historical Data Source: https://github.com/alvarobartt/investiny/blob/main/README.md Fetches historical data for a given asset from Investing.com. Requires the asset's Investing.com ID, a start date, and an end date. Supports intraday to monthly intervals. ```Python from investiny import historical_data data = historical_data(investing_id=6408, from_date="09/01/2022", to_date="10/01/2022") ``` -------------------------------- ### Search Assets and Retrieve ID Source: https://github.com/alvarobartt/investiny/blob/main/docs/usage.md Searches for assets on Investing.com based on a query, type, and exchange. It returns a list of results, including the Investing.com ID (ticker) which can be used with the historical_data function. ```Python from investiny import search_assets results = search_assets(query="AAPL", limit=1, type="Stock", exchange="NASDAQ") # Returns a list with all the results found in Investing.com ``` -------------------------------- ### Searching Assets with investiny Source: https://github.com/alvarobartt/investiny/blob/main/docs/differences-with-investpy.md Shows how to search for available assets using the `search_assets` function in the investiny library. This function helps in finding financial instruments on Investing.com. ```Python from investiny import search_assets # Example: Search for assets related to 'Apple' search_assets(query='Apple') ``` -------------------------------- ### Retrieving Historical Data with investiny Source: https://github.com/alvarobartt/investiny/blob/main/docs/differences-with-investpy.md Demonstrates how to retrieve historical data for an asset using the `historical_data` function in the investiny library. This function allows for data retrieval from 1 minute to monthly intervals. ```Python from investiny import historical_data # Example: Retrieve daily historical data for Apple Inc. historical_data(symbol='AAPL', interval='daily', outputsize='full') ``` -------------------------------- ### Combined Asset Search and Historical Data Retrieval Source: https://github.com/alvarobartt/investiny/blob/main/README.md Demonstrates how to use `search_assets` to find an asset's Investing.com ID and then use that ID with `historical_data` to retrieve its historical data. ```Python from investiny import historical_data, search_assets search_results = search_assets(query="AAPL", limit=1, type="Stock", exchange="NASDAQ") investing_id = int(search_results[0]["ticker"]) data = historical_data(investing_id=investing_id, from_date="09/01/2022", to_date="10/01/2022") ``` -------------------------------- ### Search Assets on Investing.com Source: https://github.com/alvarobartt/investiny/blob/main/README.md Searches for financial assets on Investing.com based on a query, limit, asset type, and exchange. Returns a list of matching assets, including their Investing.com ID (ticker). ```Python from investiny import search_assets results = search_assets(query="AAPL", limit=1, type="Stock", exchange="NASDAQ") ``` -------------------------------- ### investiny vs investpy Feature Comparison Source: https://github.com/alvarobartt/investiny/blob/main/docs/differences-with-investpy.md This table outlines the key differences in functionality between the investiny and investpy Python libraries for accessing financial data from Investing.com. It details support for intraday data, historical data, asset searching, dividends, economic calendars, technical indicators, and economic news. ```APIDOC Feature Comparison: | Feature | investiny | investpy | |-------------------------|-----------|----------| | Intraday Data | ✅ | ❌ | | Any Range Historical Data | ✅ | ✅ | | Search Assets/Quotes | ✅ | ✅ | | Dividends | ❌ | ✅ | | Economic Calendar | ❌ | ✅ | | Technical Indicators | ❌ | ✅ | | Economic News | ❌ | ✅ | ``` -------------------------------- ### Pandas Integration for Investiny Historical Data Source: https://github.com/alvarobartt/investiny/blob/main/docs/integrations.md Demonstrates how to fetch historical data using Investiny and convert it into a Pandas DataFrame, renaming columns and setting the index for compatibility with investpy's output format. ```Python from investiny import historical_data import pandas as pd output = historical_data(investing_id=6408) data = pd.DataFrame.from_dict(output) data.rename(columns={ "date": "Date", "open": "Open", "high": "High", "low": "Low", "close": "Close", "volume": "Volume" }, inplace=True) data.set_index("Date", inplace=True) ``` -------------------------------- ### Search Assets Function Source: https://github.com/alvarobartt/investiny/blob/main/docs/api/search.md The `search_assets` function allows users to find financial assets by name or ticker symbol. It returns a list of matching assets. ```Python def search_assets(query: str, limit: int = 10) -> list: """Searches for assets by query. Args: query: The search query (asset name or ticker). limit: The maximum number of results to return. Returns: A list of dictionaries, where each dictionary represents an asset. """ pass ``` -------------------------------- ### Fetch Historical Data Source: https://github.com/alvarobartt/investiny/blob/main/docs/api/historical.md Retrieves historical data for a given asset. This function likely handles the core logic of querying financial data sources, processing the results, and returning them in a structured format. It may accept parameters such as asset ticker, date range, and data frequency. ```Python from investiny.historical import historical_data # Example usage (assuming 'AAPL' is a valid ticker and dates are valid) # historical_data.get_historical_data(ticker='AAPL', start_date='2023-01-01', end_date='2023-12-31', interval='1d') ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.