---
title: Search from Following
description: Search within followed accounts' activity
url: https://docs.intuition.systems/docs/v1/graphql-api/queries/search/search-from-following
markdown_url: https://docs.intuition.systems/docs/v1/graphql-api/queries/search/search-from-following.md
version: V1
llms_index: https://docs.intuition.systems/docs/v1/llms.txt
---

Search for terms within the context of accounts you follow, prioritizing results from your social network.

## Search from Following - Query Structure

```graphql
query SearchTermFromFollowing(
  $address: String!
  $query: String!
  $limit: Int
) {
  search_term_from_following(
    args: {
      address: $address
      query: $query
    }
    limit: $limit
  ) {
    id
    type
    atom {
      label
      image
      creator {
        id
        label
        image
      }
    }
  }
}
```

## Variables

| Variable | Type | Required | Description |
|----------|------|----------|-------------|
| `address` | `String` | Yes | Account address whose following list to use |
| `query` | `String` | Yes | Search query text |
| `limit` | `Int` | No | Maximum results |

```json
{
  "address": "0x88D0aF73508452c1a453356b3Fac26525aEc23A2",
  "query": "defi",
  "limit": 10
}
```

## Use Cases

### Network-Aware Search

Search prioritizing content from your network:

```typescript
async function searchInNetwork(
  address: string,
  searchQuery: string
) {
  const gqlQuery = `
    query SearchFromFollowing(
      $address: String!
      $query: String!
    ) {
      network: search_term_from_following(
        args: { address: $address, query: $query }
        limit: 10
      ) {
        id
        atom {
          label
          image
          creator { id label }
        }
      }
      global: search_term(
        args: { query: $query }
        limit: 10
      ) {
        id
        atom {
          label
          image
        }
      }
    }
  `

  const data = await client.request(gqlQuery, {
    address,
    query: searchQuery
  })

  return {
    fromNetwork: data.network,
    global: data.global
  }
}
```

### React Social Search

```tsx
function SocialSearch({ address }: { address: string }) {
  const [query, setQuery] = useState('')

  const { data, loading } = useQuery(SEARCH_FROM_FOLLOWING, {
    variables: { address, query },
    skip: query.length < 2
  })

  return (
    <div>
      <input
        placeholder="Search your network..."
        value={query}
        onChange={(e) => setQuery(e.target.value)}
      />

      <div className="results">
        <h3>From Your Network</h3>
        {data?.search_term_from_following.map(term => (
          <AtomCard key={term.id} atom={term.atom} />
        ))}
      </div>
    </div>
  )
}
```

## Related

- [Search Term](https://docs.intuition.systems/docs/v1/graphql-api/queries/search/search-term) - Global search
- [Following](https://docs.intuition.systems/docs/v1/graphql-api/queries/accounts/following) - Following relationships
