VOOZH about

URL: https://apify.com/amernas/api-gw-lite

⇱ api-gw-lite Β· Apify


πŸ‘ api-gw-lite avatar

api-gw-lite

Under maintenance

Pricing

$5.00 / 1,000 results

Go to Apify Store

api-gw-lite

Under maintenance

This actor serves as a proxy that accepts requests with custom field names and translates them to standard HTTP requests to target APIs. It's designed to work seamlessly on the Apify platform while also supporting local testing

Pricing

$5.00 / 1,000 results

Rating

0.0

(0)

Developer

πŸ‘ Traffic Architect

Traffic Architect

Maintained by Community

Actor stats

1

Bookmarked

4

Total users

0

Monthly active users

4 months ago

Last modified

Share

Simple API Gateway Actor

A lightweight, efficient API Gateway that forwards HTTP requests to target APIs with proxy support and structured results.

Overview

This Apify Actor serves as a simple HTTP client that accepts requests with intuitive field names and forwards them to target APIs. It's designed for simplicity and efficiency, focusing on core functionality without unnecessary complexity.

Key Features

  • βœ… All HTTP methods (GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD)
  • βœ… Custom headers and authentication support
  • βœ… URL query parameters handling
  • βœ… JSON request bodies for POST/PUT/PATCH
  • βœ… Apify proxy integration for IP rotation
  • βœ… Structured results in Apify Results tab
  • βœ… Error handling with graceful HTTP error responses
  • βœ… Lightweight - single file implementation

Input Configuration

Required Fields

  • destination (string): The target URL endpoint

Optional Fields

  • actionType (string): HTTP method (default: "GET")
  • requestSignals (object): HTTP headers
  • queryDetails (object): URL query parameters
  • payloadContent (object): JSON request body
  • proxySettings (object): Proxy configuration

Usage Examples

1. Simple GET Request

{
"actionType":"GET",
"destination":"https://jsonplaceholder.typicode.com/posts/1",
"requestSignals":{
"User-Agent":"ApifyActor/1.0",
"Accept":"application/json"
},
"queryDetails":{
"format":"json",
"limit":"10"
}
}

2. POST with JSON Body

{
"actionType":"POST",
"destination":"https://jsonplaceholder.typicode.com/posts",
"requestSignals":{
"Content-Type":"application/json",
"Authorization":"Bearer your-token-here"
},
"payloadContent":{
"title":"Sample Post",
"body":"This is a test post",
"userId":1
}
}

3. API with Authentication

{
"actionType":"GET",
"destination":"https://api.github.com/user/repos",
"requestSignals":{
"Authorization":"token ghp_your_github_token_here",
"Accept":"application/vnd.github.v3+json"
},
"queryDetails":{
"type":"owner",
"sort":"updated",
"per_page":"5"
}
}

4. With Proxy Settings

{
"actionType":"GET",
"destination":"https://httpbin.org/ip",
"requestSignals":{
"Accept":"application/json"
},
"proxySettings":{
"useApifyProxy":true,
"apifyProxyGroups":["RESIDENTIAL"]
}
}

Field Mapping

Input FieldMaps ToPurpose
actionTypeHTTP MethodGET, POST, PUT, DELETE, etc.
destinationTarget URLComplete endpoint URL
requestSignalsHTTP HeadersAuthorization, Content-Type, etc.
queryDetailsQuery ParametersURL parameters (?key=value)
payloadContentRequest BodyJSON data for POST/PUT requests
proxySettingsProxy ConfigApify proxy settings

Output Format

The actor provides two types of output:

Results Tab (Dataset)

{
"success":true,
"status_code":200,
"content_type":"application/json",
"full_response":{"...actual API response..."}
}

Key-Value Store (OUTPUT)

Complete raw response including all headers and metadata.

File Structure

β”œβ”€β”€ apify_main.py # Main Actor implementation
β”œβ”€β”€ Dockerfile # Docker configuration
β”œβ”€β”€ requirements.txt # Python dependencies
β”œβ”€β”€ INPUT.json # Example configurations
β”œβ”€β”€ README.md # This documentation
└── .actor/
β”œβ”€β”€ actor.json # Actor metadata
└── input_schema.json # Input validation schema

Requirements

  • httpx - HTTP client library
  • apify - Apify SDK for Python

Error Handling

The actor gracefully handles:

  • ❌ Invalid URLs or network issues
  • ❌ Authentication failures
  • ❌ HTTP error status codes (4xx, 5xx)
  • ❌ Malformed JSON responses
  • ❌ Proxy connection issues

All errors are logged with detailed messages and returned in structured format.

Running the Actor

On Apify Platform

  1. Upload this actor to Apify
  2. Configure input using the examples in INPUT.json
  3. Run the actor
  4. View results in the "Results" tab

Local Testing

$python apify_main.py

Common Use Cases

  • API Testing - Test REST API endpoints
  • Data Collection - Fetch data from APIs
  • Webhook Forwarding - Forward requests to internal APIs
  • Authentication Testing - Test different auth methods
  • Proxy Testing - Test APIs through different IP addresses

Tips

  • Use httpbin.org endpoints for testing
  • Check the "Results" tab for formatted output
  • Enable Apify proxy for IP rotation
  • Add proper User-Agent headers for better success rates
  • Use Content-Type: application/json for JSON payloads

Simple, efficient, and reliable API Gateway for all your HTTP request needs! πŸš€

You might also like

Target.com Product Scraper

getdataforme/target-product-scraper

Willing to scrape product details listed on target.com then use our actor designed to scrape from target.com. As this is the first version for custom requirement please raise a tickets.

25

Sitemap Extractor

apify/sitemap-extractor

This Apify Actor extracts all URLs from a website's sitemaps and checks their status codes via lightweight HTTP requests. It provides a clean list of valid links, acting as an ideal pre-processor to ensure your larger crawling projects target only active URLs.

Google Maps Scraper

avtorizer/google-maps-scraper

Sends the requests to the Google Maps search using a built-in proxy network.

πŸ‘ User avatar

Aleksandr Vikhorev

71

Send HTTP requests

riceman/send-http-requests

Send HTTP requests (GET, POST, PUT, PATCH, DELETE) to any API endpoint with customizable headers, parameters, and body data. Perfect for Clay users seeking API functionality without the Explorer plan upgrade, or anyone needing simple HTTP request capabilities.

Scrape Emails Websites

techionik9993/static-websites-email-scraper

This Actor is a powerful and scalable solution designed to extract email addresses from static websites in a reliable and efficient manner. It leverages Python’s requests and BeautifulSoup libraries to parse HTML pages.

184

5.0

Google News Scraper

akash9078/google-news-scraper

A lightweight Google News API that provides structured news search results with HTTP-based requests.

πŸ‘ User avatar

Akash Kumar Naik

28

RequestList Bridge

pocesar/request-list-bridge

Allows you to filter (thus cleaning up your list) and append new data to those requests before sending to your target task. Also enables a workaround to provide requestsFromUrl to existing actors that don't support it natively.

HTTP API & Webhook Gateway

amernas/http-api-webhook-gateway

A versatile actor that functions as both a powerful HTTP client and a secure webhook receiver. If your application can trigger an Apify actor but can't make direct HTTP calls, use this tool to interact with any external API. It also provides a stable endpoint to receive incoming webhooks.

πŸ‘ User avatar

Traffic Architect

35

Related articles

Web scraping with Python Requests
Read more
How to use a proxy with Python Requests
Read more
Best web scraping APIs
Read more