Skill: jhumanj/apollo (version 1.0.0)

--- name: apollo description: Interact with Apollo.io REST API (people/org enrichment, search, lists). metadata: {"clawdbot":{"emoji":"🛰️","os":["darwin","linux"]}} --- # Apollo.io Interact with Apollo.io via REST API. ## Config Create `config/apollo.env` (example at `config/apollo.env.example`): - `APOLLO_BASE_URL` (usually `https://api.apollo.io`) - `APOLLO_API_KEY` Scripts load this automatically. ## Commands ### Low-level helpers - GET: `skills/apollo/scripts/apollo-get.sh "/api/v1/users"` (endpoint availability may vary) - People search (new): `skills/apollo/scripts/apollo-people-search.sh "vp marketing" 1 5` - POST (generic): `skills/apollo/scripts/apollo-post.sh "/api/v1/mixed_people/api_search" '{"q_keywords":"vp marketing","page":1,"per_page":5}'` ### Enrichment (common) - Enrich website/org by domain: `skills/apollo/scripts/apollo-enrich-website.sh "apollo.io"` - Get complete org info (bulk): `skills/apollo/scripts/apollo-orgs-bulk.sh "6136480939c707388501e6b9"` ## Notes - Apollo authenticates via `X-Api-Key` header (these scripts send it automatically). - Some endpoints require a **master API key** and a paid plan (Apollo returns `403` in that case). - Rate limiting is common (e.g. 600/hour on many endpoints); handle `429` responses.

path: scripts/apollo-config.sh
content: #!/bin/bash
set -euo pipefail

# Loads config for Apollo API scripts.
# Expected file: /Users/jhumanj/clawd/config/apollo.env

CONFIG_FILE="/Users/jhumanj/clawd/config/apollo.env"

if [ -f "$CONFIG_FILE" ]; then
  # shellcheck disable=SC1090
  source "$CONFIG_FILE"
fi

if [ -z "${APOLLO_BASE_URL:-}" ]; then
  echo "Missing APOLLO_BASE_URL. Create $CONFIG_FILE (see /Users/jhumanj/clawd/config/apollo.env.example)." >&2
  exit 1
fi

if [ -z "${APOLLO_API_KEY:-}" ]; then
  echo "Missing APOLLO_API_KEY. Create $CONFIG_FILE (see /Users/jhumanj/clawd/config/apollo.env.example)." >&2
  exit 1
fi

APOLLO_BASE_URL="${APOLLO_BASE_URL%/}"

export APOLLO_BASE_URL
export APOLLO_API_KEY


path: scripts/apollo-enrich-website.sh
content: #!/bin/bash
set -euo pipefail

# Usage: apollo-enrich-website.sh "domain.com"
# Calls: GET /api/v1/organizations/enrich?domain=...

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"

DOMAIN="${1:-}"
if [ -z "$DOMAIN" ]; then
  echo "Usage: apollo-enrich-website.sh \"domain.com\"" >&2
  exit 1
fi

# Try the commonly documented enrichment endpoint.
"$SCRIPT_DIR/apollo-get.sh" "/api/v1/organizations/enrich" "domain=$DOMAIN"


path: scripts/apollo-get.sh
content: #!/bin/bash
set -euo pipefail

# Usage: apollo-get.sh "/api/v1/path" [queryString]
# Auth: sends API key via X-Api-Key header.

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"
# shellcheck disable=SC1091
source "$SCRIPT_DIR/apollo-config.sh"

PATH_PART="${1:-}"
QUERY="${2:-}"

if [ -z "$PATH_PART" ]; then
  echo "Usage: apollo-get.sh \"/api/v1/path\" [queryString]" >&2
  exit 1
fi

URL="$APOLLO_BASE_URL$PATH_PART"
if [ -n "$QUERY" ]; then
  URL="$URL?$QUERY"
fi

curl -sS "$URL" \
  -H "X-[REDACTED_SECRET]" \
  -H "Accept: application/json"


path: scripts/apollo-orgs-bulk.sh
content: #!/bin/bash
set -euo pipefail

# Usage: apollo-orgs-bulk.sh "id1" [id2] [id3...]
# Calls: GET /organizations/bulk?organization_ids=...
# Note: Often requires master API key.

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"

if [ $# -lt 1 ]; then
  echo "Usage: apollo-orgs-bulk.sh \"orgId1\" [orgId2] ..." >&2
  exit 1
fi

IDS=$(python3 - <<'PY' "$@"
import sys
print(','.join(sys.argv[1:]))
PY
)

"$SCRIPT_DIR/apollo-get.sh" "/organizations/bulk" "organization_ids=$IDS"


path: scripts/apollo-people-search.sh
content: #!/bin/bash
set -euo pipefail

# Usage: apollo-people-search.sh "keywords" [page] [perPage]
# Uses POST /api/v1/mixed_people/api_search (new endpoint).

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"

KEYWORDS="${1:-}"
PAGE="${2:-1}"
PER_PAGE="${3:-5}"

if [ -z "$KEYWORDS" ]; then
  echo "Usage: apollo-people-search.sh \"keywords\" [page] [perPage]" >&2
  exit 1
fi

BODY=$(python3 - <<'PY' "$KEYWORDS" "$PAGE" "$PER_PAGE"
import json,sys
keywords=sys.argv[1]
page=int(sys.argv[2])
per_page=int(sys.argv[3])
print(json.dumps({"q_keywords": keywords, "page": page, "per_page": per_page}))
PY
)

"$SCRIPT_DIR/apollo-post.sh" "/api/v1/mixed_people/api_search" "$BODY"


path: scripts/apollo-post.sh
content: #!/bin/bash
set -euo pipefail

# Usage: apollo-post.sh "/api/v1/path" '{...json...}'
# Auth: send API key via X-Api-Key header.

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"
# shellcheck disable=SC1091
source "$SCRIPT_DIR/apollo-config.sh"

PATH_PART="${1:-}"
JSON_BODY="${2:-}"

if [ -z "$PATH_PART" ] || [ -z "$JSON_BODY" ]; then
  echo "Usage: apollo-post.sh \"/api/v1/path\" '{...json...}'" >&2
  exit 1
fi

URL="$APOLLO_BASE_URL$PATH_PART"

curl -sS -X POST "$URL" \
  -H "X-[REDACTED_SECRET]" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  --data "$JSON_BODY"


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)