DEV Community

I paid for an Instagram API with 3 lines of code — no signup, no API keys

I built a pay-per-request Instagram influencer search API using the x402 protocol — HTTP 402 payments in USDC on Base. This week I tested it with AgentCash to verify the full agent-to-API payment loop.

Here is the entire workflow:

Step 1: Discover the API

AgentCash automatically discovers any x402-compatible API:

discover_api_endpoints("https://socialintel.dev")
Enter fullscreen mode Exit fullscreen mode

Returns all endpoints with pricing:

  • GET /v1/search — $0.10–$0.26 depending on result count
  • GET /v1/search/free — 3 free results for testing

Step 2: Make a paid search

curl "https://socialintel.dev/v1/search?query=travel&country=US&limit=5"
# Returns: HTTP 402 Payment Required
# After x402 payment: 5 travel influencer profiles
Enter fullscreen mode Exit fullscreen mode

Verified result: 5 travel photographer profiles, follower counts 78k–85k.

On-chain proof: 0x294ec95cd8c76581e326a3b969f54e9f6a0561489cd7cdb2da34ff372eca6c77

Why x402 matters for AI agents

Traditional APIs need API key registration, monthly subscriptions, and a human to set up billing.

x402 APIs need a funded wallet and one line of code. The agent pays autonomously. No human in the loop.

Try it

Free demo (no wallet needed):

GET https://socialintel.dev/v1/search?query=travel&demo=true
Enter fullscreen mode Exit fullscreen mode

Paid search: point any x402 client at https://socialintel.dev/v1/search

Building in public. Launching on Product Hunt March 30.

Top comments (0)