I keep getting Wrong API key error 403 from pinecone

it’s my first time using VDB and I wrote some basic scraping and embedding code for the test. I can’t understand what’s wrong with API, but I keep getting the same error. Here’s my code and the output. Additionally, if you could recommend VDB for newcomers it would be great. Thanks in advance.

import os
import requests
from bs4 import BeautifulSoup
import re
from fake_useragent import UserAgent
import openai
import pinecone

# Initialize Pinecone
pc = Pinecone(api_key='')
index_name = "web"

# Check if the index exists, otherwise create one
if index_name not in pc.list_indexes().names():
    pinecone.create_index(name=index_name, dimension=1536)  # Ensure dimension matches your embedding dimension
index = pinecone.Index(index_name, host='https://web-mcilcxv.svc.aped-4627-b74a.pinecone.io')

# Securely fetch your OpenAI API key
openai.api_key = ''

# List of website URLs
website_urls = [
    "https://www.accel.com", "https://www.a16z.com", "https://www.greylock.com",
    "https://www.benchmark.com", "https://www.sequoiacap.com", "https://www.indexventures.com",
    "https://www.kpcb.com", "https://www.lsvp.com", "https://www.matrixpartners.com",
    "https://www.500.co", "https://www.sparkcapital.com", "https://www.insightpartners.com"
]

def scrape_home_page_and_save_text(url):
    try:
        ua = UserAgent()
        headers = {'User-Agent': ua.random}
        response = requests.get(url, headers=headers)
        if response.status_code == 200:
            soup = BeautifulSoup(response.content, 'html.parser')
            text_content = re.sub(r's+', ' ', soup.get_text()).strip()
            print(f"Scraped {url} successfully.")
            return text_content
        else:
            print(f"Failed to scrape {url}. Status code: {response.status_code}")
            return None
    except Exception as e:
        print(f"An error occurred while scraping {url}: {str(e)}")
        return None

def embed_text_content(text_content):
    try:
        response = openai.Embedding.create(input=text_content, model="text-embedding-ada-002")
        return response['data'][0]['embedding']  # Accessing embedding data correctly
    except openai.Error as e:  # Catching OpenAI specific errors
        print(f"An error occurred while generating embedding: {str(e)}")
        return None


# Scrape, embed, and store data
embeddings = []
ids = []
for url in website_urls:
    print(f"Scraping {url}...")
    text_content = scrape_home_page_and_save_text(url)
    if text_content:
        print(f"Embedding content from {url}...")
        embedding = embed_text_content(text_content)
        if embedding:
            embeddings.append(list(embedding))
            ids.append(url)

# Batch upsert to Pinecone
if embeddings and ids:
    index.upsert(vectors=list(zip(ids, embeddings)))
    print(f"Data for all sites uploaded to Pinecone.")

print("Scraping, embedding, and uploading finished.")

Reason: Forbidden HTTP response headers: HTTPHeaderDict({'Date': 'Wed, 01 May 2024 10:37:34 GMT', 'Content-Type': 'text/plain', 'Content-Length': '9', 'Connection': 'keep-alive', 'x-pinecone-auth-rejected-reason': 'Wrong API key', 'www-authenticate': 'Wrong API key', 'server': 'envoy'}) HTTP response body: Forbidden

I double checked the api and tried with env variables.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật