Skip to content

How to use getFeedSkeleton and getFeed API #129

Description

@leachuk

I'd like to build out my own feed client for testing of my own feed generator.

I have the custom feed generator available on my local network and can access is fine with

const agent = new AtpAgent({
  service: "http://192.168.0.94:30100"
});

feedRes = await agent.app.bsky.feed.getFeed({
  feed: "at://did:plc:l4h6ktmviiwqdmldqrss64zw/app.bsky.feed.generator/whats-alf"
});

But when I try and hit that endpoint outside of the JS client, e.g. in the browser or curl, I get an error

curl -G GET 'http://192.168.0.94:30100/xrpc/app.bsky.feed.getFeed' \
  -d 'feed=at://did:plc:l4h6ktmviiwqdmldqrss64zw/app.bsky.feed.generator/whats-alf' \
  -d 'limit=5'

# Results in curl: (6) Could not resolve host: GET

However, I can change the curl command to use getFeedSkeleton and it works as expected

curl -G GET 'http://192.168.0.94:30100/xrpc/app.bsky.feed.getFeedSkeleton' \
  -d 'feed=at://did:plc:l4h6ktmviiwqdmldqrss64zw/app.bsky.feed.generator/whats-alf' \
  -d 'limit=5'

And this may or may not be related, but I don't appear to be able to getFeedSkeleton for any feed via a remote (none localhost, which does work) host. So this doesn't work (I've tried multiple hostnames)

curl -X GET https://api.bsky.app/xrpc/app.bsky.feed.getFeedSkeleton \
  -H "Authorization: Bearer TOKEN_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "feed": "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/whats-hot",
    "limit": 20
  }'

It would be nice to understand why I'm seeing this behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions