# Natural Gas Pipeline Proximity Screener — US EIA/NTAD Lines (`malonestar/ntad-gas-pipeline-proximity-screener`) Actor

Natural gas pipeline proximity check for site selection, ROW encroachment, and Phase I due diligence. Batch lat/lon in; nearest-pipeline distance, operator, interstate/intrastate type, status, and encroachment band out. Built on the USDOT NTAD / EIA national pipeline layer.

- **URL**: https://apify.com/malonestar/ntad-gas-pipeline-proximity-screener.md
- **Developed by:** [Kyle Maloney](https://apify.com/malonestar) (community)
- **Categories:** Real estate, Developer tools, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.40 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Natural Gas Pipeline Proximity Screener — US EIA/NTAD Lines

Natural gas pipeline map proximity check: give this actor a list of sites
(lat/lon) and it returns the nearest natural-gas transmission pipeline
segment for each one — operator, interstate/intrastate type, status,
distance in miles, compass bearing, and a right-of-way (ROW) encroachment
band (`<500ft`, `<0.25mi`, `<1mi`, `>1mi`, or `NONE`). Built on the US DOT
National Transportation Atlas Database (NTAD) natural gas pipeline layer
(sourced from EIA).

### Who this is for
- **Pipeline ROW / encroachment teams** monitoring third-party construction, grading, or new structures near a pipeline corridor.
- **Energy and industrial site-selection teams** screening candidate parcels for pipeline proximity before a land option or lease.
- **Excavation, HDD (horizontal directional drilling), and utility-locate contractors** doing a first-pass desktop check before dispatching a locate crew.
- **Phase I Environmental Site Assessment (ESA) consultants** who need a documented pipeline-proximity finding for a report.
- **Real estate / title / insurance due diligence** teams screening a property portfolio for gas-transmission-line exposure.

### What it does
For each input site, the actor:
1. Builds a bounding-box (envelope) query around the site at your chosen radius (default 5 miles).
2. Queries the NTAD/EIA natural gas pipeline ArcGIS FeatureServer for polyline segments intersecting that envelope.
3. Computes the true nearest-point-on-line distance (not just centroid distance) for every candidate segment, filters to those actually within the radius, and sorts nearest-first.
4. Emits one row per nearby pipeline segment (up to `maxPipelinesPerAsset`), each carrying the segment's own distance/operator/type/status plus per-asset summary fields (nearest distance/operator overall, total pipeline count within radius, and the encroachment band).
5. If nothing is found within radius, emits a single explicit "clear" row (`clear_flag: true`) so a zero-result site is never silently missing from your dataset.

### Example input
```json
{
  "assets": [
    { "lat": 29.76, "lon": -95.37, "label": "Houston TX site" },
    { "lat": 38.48, "lon": -98.02, "label": "Rural KS control" }
  ],
  "radiusMiles": 5,
  "maxPipelinesPerAsset": 25
}
````

Each asset accepts `{ "lat": ..., "lon": ..., "label": "..." }`, a `"lat,lon"` string, or a `[lat, lon]` array.

### Output fields

| Field | Description |
|---|---|
| `asset_label` / `asset_lat` / `asset_lon` | The screened site as provided. |
| `operator` | Operator of this pipeline segment. |
| `typepipe` | NTAD/EIA pipeline type (e.g. Interstate, Intrastate). |
| `status` | Raw NTAD/EIA status for the segment. |
| `distance_miles` | Distance in miles from the site to the nearest point on this segment. |
| `bearing_deg` | Compass bearing (0–360°, 0 = north) from the site to that nearest point. |
| `within_radius` | True for pipeline-hit rows; false on the clear row. |
| `nearest_distance_miles` / `nearest_operator` | Per-asset summary: the single closest pipeline overall. |
| `pipelines_within_radius` | Per-asset summary: total distinct segments found within radius. |
| `encroachment_band` | `<500ft`, `<0.25mi`, `<1mi`, `>1mi`, `NONE`, or `ERROR`. |
| `clear_flag` | True only on the explicit zero-hit row for an asset. |
| `error` | Populated only on ERROR rows (bad coordinates or upstream failure). |
| `checked_at` / `source_url` | Run timestamp and the NTAD/EIA layer queried. |

### Use as an MCP tool

This actor is Pay-Per-Event (Result-only billing) and discoverable to AI
agents via mcp.apify.com — Claude, Cursor, and other MCP clients can call it
directly as a "find the nearest gas pipeline to this address/coordinate"
tool, chaining it with geocoders or other siting/proximity actors (electric
grid, wetlands, floodplain, critical habitat) for a combined due-diligence
workflow.

### FAQ

**How close is the nearest gas pipeline to an address?** Geocode the
address to lat/lon, pass it in `assets`, and read `nearest_distance_miles`
and `encroachment_band` from the result.

**Is there a pipeline near my property?** Yes — set a `radiusMiles` that
matches your ROW/setback concern (e.g. 0.25–1 mile) and check
`pipelines_within_radius` and `clear_flag`.

**Is there a gas transmission line map API?** This actor wraps the US DOT
NTAD natural gas pipeline layer (sourced from EIA) behind a simple
lat/lon-in, distance-out API — no GIS software required.

**What does the encroachment band mean?** It's an editorial proximity
classification (`<500ft` / `<0.25mi` / `<1mi` / `>1mi`) based on the
distance to the nearest in-radius pipeline segment — useful for flagging
sites that need a closer ROW/encroachment review or an operator call.

### Data source & disclaimer

Source: US DOT National Transportation Atlas Database (NTAD), "Natural Gas
Pipelines" layer (sourced from EIA), a public ArcGIS FeatureServer. This is
an **informational proximity screen only** — not a locate ticket, survey, or
official right-of-way determination. Pipeline geometry is a compiled
national reference and can lag as-built conditions. Before excavation,
siting, or a Phase I ESA conclusion, call 811 / your state one-call center
and confirm with the pipeline operator of record.

### Pricing

Pay-Per-Event: $8 per 1,000 result rows (Apify default-dataset-item event).
Empty/clear results still cost the buyer only the tiny actor-start.

# Actor input Schema

## `assets` (type: `array`):

Sites to screen for natural-gas pipeline proximity. Each entry is an object with lat, lon, and an optional label. Also accepts lat,lon strings or \[lat, lon] arrays. One or more dataset rows (billed results) are produced per asset: one row per nearby pipeline segment (nearest first), or a single clear-flag row when none are within radius. A bad entry yields an ERROR row and the run continues.

## `radiusMiles` (type: `number`):

Radius around each asset to search for natural-gas pipeline segments, in miles (0.1-50). Segments beyond this distance are ignored. Default 5.

## `maxPipelinesPerAsset` (type: `integer`):

Maximum number of nearby pipeline-segment rows returned per asset (nearest first), 1-200. The pipelines\_within\_radius summary field still reports the true total found. Default 25.

## `maxAssets` (type: `integer`):

Maximum number of assets to screen from the assets list (safety cap), 1-2000. Extra assets beyond this are skipped with an ERROR row. Default 500.

## Actor input object example

```json
{
  "assets": [
    {
      "lat": 29.76,
      "lon": -95.37,
      "label": "Houston TX site"
    },
    {
      "lat": 38.48,
      "lon": -98.02,
      "label": "Rural KS control"
    }
  ],
  "radiusMiles": 5,
  "maxPipelinesPerAsset": 25,
  "maxAssets": 500
}
```

# Actor output Schema

## `results` (type: `string`):

The default dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "assets": [
        {
            "lat": 29.76,
            "lon": -95.37,
            "label": "Houston TX site"
        },
        {
            "lat": 38.48,
            "lon": -98.02,
            "label": "Rural KS control"
        }
    ],
    "radiusMiles": 5,
    "maxPipelinesPerAsset": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("malonestar/ntad-gas-pipeline-proximity-screener").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "assets": [
        {
            "lat": 29.76,
            "lon": -95.37,
            "label": "Houston TX site",
        },
        {
            "lat": 38.48,
            "lon": -98.02,
            "label": "Rural KS control",
        },
    ],
    "radiusMiles": 5,
    "maxPipelinesPerAsset": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("malonestar/ntad-gas-pipeline-proximity-screener").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "assets": [
    {
      "lat": 29.76,
      "lon": -95.37,
      "label": "Houston TX site"
    },
    {
      "lat": 38.48,
      "lon": -98.02,
      "label": "Rural KS control"
    }
  ],
  "radiusMiles": 5,
  "maxPipelinesPerAsset": 25
}' |
apify call malonestar/ntad-gas-pipeline-proximity-screener --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=malonestar/ntad-gas-pipeline-proximity-screener",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Natural Gas Pipeline Proximity Screener — US EIA/NTAD Lines",
        "description": "Natural gas pipeline proximity check for site selection, ROW encroachment, and Phase I due diligence. Batch lat/lon in; nearest-pipeline distance, operator, interstate/intrastate type, status, and encroachment band out. Built on the USDOT NTAD / EIA national pipeline layer.",
        "version": "1.0",
        "x-build-id": "yXxWoR0p9Th53JFxJ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/malonestar~ntad-gas-pipeline-proximity-screener/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-malonestar-ntad-gas-pipeline-proximity-screener",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/malonestar~ntad-gas-pipeline-proximity-screener/runs": {
            "post": {
                "operationId": "runs-sync-malonestar-ntad-gas-pipeline-proximity-screener",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/malonestar~ntad-gas-pipeline-proximity-screener/run-sync": {
            "post": {
                "operationId": "run-sync-malonestar-ntad-gas-pipeline-proximity-screener",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "assets"
                ],
                "properties": {
                    "assets": {
                        "title": "Assets (sites to screen)",
                        "type": "array",
                        "description": "Sites to screen for natural-gas pipeline proximity. Each entry is an object with lat, lon, and an optional label. Also accepts lat,lon strings or [lat, lon] arrays. One or more dataset rows (billed results) are produced per asset: one row per nearby pipeline segment (nearest first), or a single clear-flag row when none are within radius. A bad entry yields an ERROR row and the run continues."
                    },
                    "radiusMiles": {
                        "title": "Search radius (miles)",
                        "minimum": 0.1,
                        "maximum": 50,
                        "type": "number",
                        "description": "Radius around each asset to search for natural-gas pipeline segments, in miles (0.1-50). Segments beyond this distance are ignored. Default 5.",
                        "default": 5
                    },
                    "maxPipelinesPerAsset": {
                        "title": "Max pipeline segments per asset",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Maximum number of nearby pipeline-segment rows returned per asset (nearest first), 1-200. The pipelines_within_radius summary field still reports the true total found. Default 25.",
                        "default": 25
                    },
                    "maxAssets": {
                        "title": "Max assets",
                        "minimum": 1,
                        "maximum": 2000,
                        "type": "integer",
                        "description": "Maximum number of assets to screen from the assets list (safety cap), 1-2000. Extra assets beyond this are skipped with an ERROR row. Default 500.",
                        "default": 500
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
