PostgreSQL Database Extractor avatar

PostgreSQL Database Extractor

Pricing

Pay per event

Go to Apify Store
PostgreSQL Database Extractor

PostgreSQL Database Extractor

Extracts data from PostgreSQL databases. Connects via connection string or individual credentials, supports SSL, table selection, and row limits. Returns each row as a flat JSON object.

Pricing

Pay per event

Rating

5.0

(1)

Developer

ParseForge

ParseForge

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

7 days ago

Last modified

Share

ParseForge

PostgreSQL Database Extractor

Extract data from any PostgreSQL database into clean, flat datasets. Connect with a connection string or individual credentials, select specific tables, and export to CSV, JSON, Excel, or XML. No complex setup, no API limits.

PostgreSQL databases hold critical business data, but moving that data into analytics tools or spreadsheets often means writing custom scripts or dealing with complex ETL pipelines. This Actor connects directly to your PostgreSQL instance, reads the tables you specify, and returns each row as a structured record. It works with self-hosted and cloud databases, supports SSL, and lets you filter tables and limit rows per table.

Who uses itWhat they scrape PostgreSQL for
Data analystsPull database tables into CSV or JSON for analysis in Excel, Python, or BI tools.
DevelopersAutomate database backups or sync data to other systems without writing custom code.
Business intelligence teamsExtract operational data from PostgreSQL into data warehouses or reporting platforms.
Data engineersSet up scheduled extractions from production databases to feed downstream pipelines.

What it does

This Actor connects to a PostgreSQL database, extracts rows from selected tables, and returns each row as a flat JSON object.

  • 🔌 Flexible connection: Use a full connection string or provide host, port, database, username, and password separately.
  • 🔒 SSL support: Enable SSL to connect securely to cloud databases like AWS RDS, Google Cloud SQL, or Azure Database for PostgreSQL.
  • 📋 Table selection: Specify exact tables to extract, exclude unwanted tables, or extract all tables by default.
  • 📏 Row limits: Cap the number of rows per table to avoid huge extractions or sample data quickly.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

What you can do with PostgreSQL data

📊 Export tables for analysis.

A data analyst connects to the company PostgreSQL database, selects the sales and customers tables, and exports them to CSV for pivot tables in Excel.

🔄 Sync data to another system.

A developer schedules the Actor to extract new orders from PostgreSQL every hour and feed them into a CRM or data warehouse.

🗄️ Create database backups.

An operations team runs the Actor daily to dump all tables from a production database into JSON files stored in Apify's dataset.

🧪 Sample data for testing.

A QA engineer extracts the first 100 rows from each table to create a realistic test dataset without copying the entire database.

Why choose this scraper

What you get
Direct database accessConnect to any PostgreSQL instance with standard credentials or a connection string.
Structured outputEach table row becomes a flat JSON object, ready for export to CSV, JSON, Excel, or XML.
Selective extractionChoose specific tables, exclude others, and limit rows to keep datasets manageable.
Cloud-readySSL support ensures secure connections to managed PostgreSQL services.

How it compares

No other Store actor targets PostgreSQL the same way, so the honest comparison is with the alternatives teams actually weigh.

PostgreSQL Database ExtractorBuild it in-houseBy hand
SetupRun it now, zero configDays of engineeringNone, but hours per pull
When PostgreSQL changesMaintained for youYou fix itYou re-learn the page
Proxies, retries, anti-botBuilt inYour problemBrowser only
OutputFixed JSON schema, CSV/Excel exportWhatever you buildCopy-paste
CostPay per resultEngineering timeAnalyst hours

Configure the run

Provide connection details, optionally list tables to include or exclude, and set a maximum row count per table. The Actor reads only the data you request and returns it in a consistent schema. The Input tab lists every parameter.

A first run with the defaults:

{
"host": "localhost",
"port": 5432,
"database": "mydb",
"username": "user",
"password": "password",
"tables": [],
"excludeTables": [],
"maxRowsPerTable": 100
}

Pricing

Pay-per-result: $0.008 per result collected. You pay only for the results written to your dataset.

Results collectedApproximate cost
100 results$0.80
1,000 results$8.00
10,000 results$80.00

New Apify accounts start with $5 in free credit.

Free users

Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the PostgreSQL Database Extractor.
  3. Set your inputs and any filters, then click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab.

Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

Give an AI agent live access to PostgreSQL through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

$claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/postgresql-database-extractor"

Then prompt it in plain language to run the scraper and read back the results.

Troubleshooting

Why am I getting a connection error?

Check that the host, port, database, username, and password are correct. If connecting to a cloud database, ensure SSL is enabled and that your IP is allowed in the database's firewall rules.

Why are some tables not extracted?

Verify the table names in your 'Tables to Extract' list, including the schema prefix. Also check that your database user has SELECT permission on those tables.

Why is the run taking a long time?

Large tables can slow down extraction. Set a 'Max Rows Per Table' limit to sample data, or exclude large tables you don't need.

Why do I get an SSL error?

Some PostgreSQL servers require SSL. Enable the 'Use SSL' option in the input. If the server uses a self-signed certificate, you may need to adjust the connection string with sslmode=require.

Why is my password not working?

Ensure there are no leading or trailing spaces in the password field. If your password contains special characters, try using a connection string instead of separate fields.

FAQ

QuestionAnswer
How do I connect to my PostgreSQL database?You can provide a full connection string like postgresql://user:password@host:port/database, or enter the host, port, database, username, and password separately. If a connection string is provided, the other fields are ignored.
Does this work with cloud databases like AWS RDS or Google Cloud SQL?Yes. Enable the SSL option in the input to establish a secure connection to most managed PostgreSQL services.
Can I extract only certain tables?Yes. Use the 'Tables to Extract' field to list specific tables, or use 'Tables to Exclude' to skip unwanted tables. If neither is provided, all tables are extracted.
How do I limit the number of rows extracted?Set the 'Max Rows Per Table' field to a positive integer. The Actor will extract up to that many rows from each table. If left empty, all rows are extracted.
What format is the output data in?The Actor returns each table row as a flat JSON object. You can export the dataset to CSV, JSON, Excel, or XML from the Apify platform.
Is my database password stored securely?Yes. All input fields, including passwords, are encrypted at rest and in transit by Apify. The password is only used to establish the connection during the run.
Can I schedule this Actor to run automatically?Yes. You can set up a schedule in Apify to run the Actor at regular intervals, such as daily or hourly, to keep your extracted data up to date.
What happens if a table has no rows?The Actor will return an empty array for that table. The run will still succeed, and other tables will be extracted normally.
Does this Actor modify my database?No. It only performs SELECT queries to read data. It does not insert, update, or delete any records.
Can I extract data from a specific schema?Yes. When listing tables, include the schema name, such as 'public.users' or 'sales.orders'. If you omit the schema, the default 'public' schema is assumed.

Browse the full ParseForge collection for more scrapers.

🆘 Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by PostgreSQL Global Development Group. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.