Skip to content
slack-api logo

slack-api

Read Slack messages, threads, channels, download attachments via Python API. Use when you see Slack URLs (https://*.slack.com/archives/*/p*) or need to interact with Slack.

SKILL.md

Full skill instructions

Slack API

Read and interact with Slack using Python (no MCP required).

Quick Reference

# Read message/​thread from URL
python3 ~/​.claude/​skills/​slack-api/​scripts/​slack.py --url "SLACK_URL"

# Channel history / Thread replies
python3 ~/​.claude/​skills/​slack-api/​scripts/​slack.py --history -c CHANNEL_ID -l 10
python3 ~/​.claude/​skills/​slack-api/​scripts/​slack.py --replies -c CHANNEL_ID --thread-ts TS

# Search / List channels / User info
python3 ~/​.claude/​skills/​slack-api/​scripts/​slack.py --search "query"
python3 ~/​.claude/​skills/​slack-api/​scripts/​slack.py --list-channels
python3 ~/​.claude/​skills/​slack-api/​scripts/​slack.py --user-info USER_ID

# List files from thread (with details)
python3 ~/​.claude/​skills/​slack-api/​scripts/​slack.py --url "URL" --list-files -v

# Download all files from thread
python3 ~/​.claude/​skills/​slack-api/​scripts/​slack.py --url "URL" --download-files -o ./​downloads

# Output JSON
python3 ~/​.claude/​skills/​slack-api/​scripts/​slack.py --url "URL" --json

Commands

FlagDescriptionRequired
--urlRead from Slack URLURL
--historyChannel messages-c
--repliesThread replies-c, --thread-ts
--searchSearch messagesquery
--list-channelsList channels-
--user-infoUser detailsuser_id
--postPost message-c, -t
--list-filesList files with details--url or messages
--download-filesDownload all files--url or messages

Options

-c/--channel, --thread-ts, -l/--limit (20), -o/--output-dir (./​slack-downloads), -v/--verbose, --json

Auth

Tokens loaded from ~/​.claude/​skills/​slack-api/​.env:

SLACK_XOXC_TOKEN=xoxc-...
SLACK_XOXD_TOKEN=xoxd-...

Get tokens: Browser DevTools -> Application -> Cookies (logged into Slack)

URL Parsing

p1767879572095059 -> 1767879572.095059 (insert dot 6 chars from end)