Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/polite-dancers-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"api": patch
---

fix: v2 opensea collection data api
6 changes: 3 additions & 3 deletions examples/api/src/app/api/open-graph/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export async function fetchNFTMetadata({
const collectionData = await collectionResponse.json();

const collectionStatsResponse = await fetch(
`https://api.opensea.io/api/v1/collection/${collectionSlug}/stats`,
`https://api.opensea.io/api/v2/collections/${collectionSlug}/stats`,
authOptions
);
// Collection stats should exist if the collection exists
Expand Down Expand Up @@ -177,8 +177,8 @@ export async function fetchNFTMetadata({
creatorAddress: collectionData.owner,
name: collectionData.name,
description: collectionData.description,
itemCount: collectionStats.stats.count,
ownerCount: collectionStats.stats.num_owners,
itemCount: collectionStats.total.count || 0,
ownerCount: collectionStats.total.num_owners,
imageUrl: image,
// Always include the mint url if it was specified
mintUrl: mintUrl,
Expand Down