Use the BigCommerce REST API and Python SDK to create category pages, assign products, and connect your store to Similar AI.
We use the official BigCommerce Python package to manage your category pages. The approach is straightforward:
For the full onboarding flow, see the New Page onboarding checklist.
V2/V3 API token.None to modify. This is required because creating category pages needs modify permissions.Verify your API token works by fetching the product catalog. Replace dd02dnjzrx with your store ID and include your token in the X-Auth-Token header.
GET https://api.bigcommerce.com/stores/{store_id}/v3/catalog/products
Headers:
X-Auth-Token: your-access-token
Content-Type: application/jsonIf you receive a 200 response with your product list, the token is working correctly.
Create an invisible parent category that will hold all Similar AI pages. Send a POST request to the categories endpoint:
POST https://api.bigcommerce.com/stores/{store_id}/v3/catalog/trees/categories
Body:
[
{
"name": "SimilarPage",
"url": {
"path": "/s-test-page/",
"is_customized": false
},
"parent_id": 0,
"tree_id": 1,
"description": "<p>Category description</p>",
"sort_order": 3,
"page_title": "Similar Test Page",
"meta_keywords": ["keyword1", "keyword2"],
"meta_description": "string",
"layout_file": "category.html",
"is_visible": true,
"default_product_sort": "use_store_settings"
}
]false if you want to hide the parent page from navigation.Save the category ID from the response. You will need it in the next step.
Use the same endpoint to create child pages. Replace parent_id with the category ID returned in the previous step.
POST https://api.bigcommerce.com/stores/{store_id}/v3/catalog/trees/categories
Body:
[
{
"name": "Child Page Name",
"url": {
"path": "/s-test-page/child-page/",
"is_customized": false
},
"parent_id": 123,
"tree_id": 1,
"description": "<p>Child category description</p>",
"page_title": "Child Page Title",
"meta_keywords": ["keyword1", "keyword2"],
"meta_description": "Child page meta description",
"layout_file": "category.html",
"is_visible": true,
"default_product_sort": "use_store_settings"
}
]Repeat this call for each child page you need. All child pages nest under the parent category created in step 3.
Once your category pages exist, assign products to them using a PUT request to the category-assignments endpoint:
PUT https://api.bigcommerce.com/stores/{store_id}/v3/catalog/products/category-assignments
Body:
[
{
"product_id": 456,
"category_id": 123
},
{
"product_id": 789,
"category_id": 123
}
]You can assign multiple products in a single request by adding more objects to the array.
We handle the API integration for you. Share your credentials and we will have your new pages live within days.