How to load data from Polygon Stock API to ElasticSearch
Learn how to use Airbyte to synchronize your Polygon Stock API data into ElasticSearch within minutes.


Building your pipeline or Using Airbyte
Airbyte is the only open source solution empowering data teams to meet all their growing custom business demands in the new AI era.
- Inconsistent and inaccurate data
- Laborious and expensive
- Brittle and inflexible
- Reliable and accurate
- Extensible and scalable for all your needs
- Deployed and governed your way
Start syncing with Airbyte in 3 easy steps within 10 minutes



Take a virtual tour
Demo video of Airbyte Cloud
Demo video of AI Connector Builder
Setup Complexities simplified!
Simple & Easy to use Interface
Airbyte is built to get out of your way. Our clean, modern interface walks you through setup, so you can go from zero to sync in minutes—without deep technical expertise.
Guided Tour: Assisting you in building connections
Whether you’re setting up your first connection or managing complex syncs, Airbyte’s UI and documentation help you move with confidence. No guesswork. Just clarity.
Airbyte AI Assistant that will act as your sidekick in building your data pipelines in Minutes
Airbyte’s built-in assistant helps you choose sources, set destinations, and configure syncs quickly. It’s like having a data engineer on call—without the overhead.
What sets Airbyte Apart
Modern GenAI Workflows
Move Large Volumes, Fast
An Extensible Open-Source Standard
Full Control & Security
Fully Featured & Integrated
Enterprise Support with SLAs
What our users say

Raman Singh
Predictable, straightforward pricing model that simplified budgeting and significantly reduced overall spend

Chase Zieman

“Airbyte helped us accelerate our progress by years, compared to our competitors. We don’t need to worry about connectors and focus on creating value for our users instead of building infrastructure. That’s priceless. The time and energy saved allows us to disrupt and grow faster.”

Rupak Patel
"With Airbyte, we could just push a few buttons, allow API access, and bring all the data into Google BigQuery. By blending all the different marketing data sources, we can gain valuable insights."
How to Sync to Manually
Begin by setting up your environment. Install Python and necessary libraries such as `requests` for API calls and `elasticsearch` for interacting with Elasticsearch. Ensure Python is correctly installed and configured on your system.
Obtain an API key from Polygon.io by signing up for an account. With this key, you can authenticate and make requests to the Polygon Stock API. Use `requests` in Python to fetch stock data. For example, use `requests.get` with the appropriate endpoint and query parameters to retrieve data.
Once you receive the data from the API, you'll need to parse the JSON response. Use Python's built-in `json` module to convert the JSON string into a Python dictionary. This will allow you to manipulate and extract the necessary data fields for insertion into Elasticsearch.
Before inserting data, create an index in Elasticsearch where your stock data will be stored. Use Elasticsearch's HTTP API to create an index with a suitable mapping. Define the fields and data types that match the structure of the data you plan to insert. You can use `curl` or Python's `elasticsearch` client to achieve this.
Transform the parsed data into a format compatible with Elasticsearch. This often involves converting timestamps to the appropriate format and ensuring that numeric and text data types align with your index mapping. Create a function in Python that formats each record accordingly.
Use the `elasticsearch` Python client to insert data. Connect to your Elasticsearch instance, and use the `index()` method to add documents to your index. Iterate over your transformed data and insert each record. Handle exceptions to ensure robustness, such as reconnecting on failures.
After data insertion, verify that the data is correctly stored in Elasticsearch. Use Elasticsearch's search API to query your index and check that the documents are present and correctly formatted. This can be done using Python to programmatically check, or manually using tools like Kibana for visualization.
By following these steps, you can efficiently transfer data from the Polygon Stock API to Elasticsearch, ensuring that each component is properly configured and data integrity is maintained throughout the process.