# Can we import collection without using third party API key

**URL:** <https://forum.weaviate.io/t/can-we-import-collection-without-using-third-party-api-key/9831>\
**Category:** General\
**Created:** [January 21, 2025, 7:20am UTC](https://forum.weaviate.io/t/can-we-import-collection-without-using-third-party-api-key/9831 "2025-01-21T07:20:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chiranjithazra](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@chiranjithazra](https://forum.weaviate.io/u/chiranjithazra)\
**Post date:** [January 21, 2025, 7:20am UTC](https://forum.weaviate.io/t/can-we-import-collection-without-using-third-party-api-key/9831/1 "2025-01-21T07:20:48Z")

</div>

Hi All,  
I try to use

client = connect\_to\_weaviate()

# client = weaviate.connect\_to\_local()

df = pd.read\_json(‘mtcars.json’,lines=True)  
column\_names = df.columns

properties\_list =   
for column\_name in column\_names:  
# print(column\_name)  
properties\_list.append(wc.Property(name=column\_name, data\_type=wc.DataType.TEXT))  
# print(properties\_list)

print(properties\_list)  
client.collections.create(  
name=“Cars”,  
properties=properties\_list,  
# Define the vectorizer module  
vectorizer\_config=wc.Configure.Vectorizer.text2vec\_openai(),  
# Define the generative module  
generative\_config=wc.Configure.Generative.openai()  
)

# Get the collection

cars = client.collections.get(“Cars”)

# Enter context manager

with cars.batch.dynamic() as batch:  
# Loop through the data  
for i, car in tqdm(df.iterrows()):  
# Convert data types  
# Convert a JSON array to a list of integers

```
    # Build the object payload
    car_obj = {}
    for value in column_names:
        car_obj[value]= str(car[value])

    # print(car_obj)
    # Add object to batch queue
    # print(generate_uuid5(car["model"]))
    batch.add_object(
        properties=car_obj,
        uuid=generate_uuid5(car["model"])
        # references=reference_obj # You can add references here
    )
    # Batcher automatically sends batches

```

# Check for failed objects

if len(cars.batch.failed\_objects) \> 0:  
print(f"Failed to import {len(cars.batch.failed\_objects)} objects")

but I got error to provide  
headers = {“X-OpenAI-Api-Key”: os.getenv(“OPENAI\_APIKEY”)} # Replace with your OpenAI API key

can we create and import collection dataset without using headers or third party API keys

Thanks

---

<div class="post-metadata">

**Author:** ![Shahin](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/shahin/32/7944_2.png) [@Shahin](https://forum.weaviate.io/u/Shahin)\
**Post date:** [January 21, 2025, 4:42pm UTC](https://forum.weaviate.io/t/can-we-import-collection-without-using-third-party-api-key/9831/2 "2025-01-21T16:42:35Z")

</div>

Hi @chiranjithazra,

Welcome to our community and it’s great to have you here.

You may need to set the vectorizer to none on the collection level. Here’s how you can do it:

> import weaviate.classes as wvc
> 
> questions = client.collections.create(  
> “Question”,  
> vectorizer\_config=wvc.config.Configure.Vectorizer.none(),  
> )

Regards,  
Mohamed Shahin  
Weaviate Support

---

<div class="post-metadata">

**Author:** ![chiranjithazra](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@chiranjithazra](https://forum.weaviate.io/u/chiranjithazra)\
**Post date:** [January 21, 2025, 6:03pm UTC](https://forum.weaviate.io/t/can-we-import-collection-without-using-third-party-api-key/9831/3 "2025-01-21T18:03:56Z")

</div>

Hi @Shahin

Thanks for your response.

But if I use  
questions = client.collections.create(  
“Question”,  
vectorizer\_config=wvc.config.Configure.Vectorizer.none(),  
)

then  
response = cars.query.near\_text(  
query=“Merc”,  
limit=2,  
return\_metadata=wq.MetadataQuery(distance=True)  
)

```
for o in response.objects:
    print(o.properties)
    print(o.metadata.distance)

### Not Working due to :--- vectorize params: could not vectorize input for collection DipsCarsTest with search-type nearText. Make sure a vectorizer module is configured for this collection

```

This one not working

can you help me on this?

Thanks

---

<div class="post-metadata">

**Author:** ![Shahin](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/shahin/32/7944_2.png) [@Shahin](https://forum.weaviate.io/u/Shahin)\
**Post date:** [January 22, 2025, 1:51pm UTC](https://forum.weaviate.io/t/can-we-import-collection-without-using-third-party-api-key/9831/4 "2025-01-22T13:51:49Z")

</div>

Hi @chiranjithazra,

I apologize for my misread earlier regarding the near\_text(). This will require a vectorizer because when you insert a query with a string as “Merc,” this string needs to be vectorized before performing a similarity search. Initially, I thought you were using near\_vector().

With Vectorizer set to none, bring your own vectors, you can search with near\_vector without the need for a vectorizer. However, if you plan to use near\_text and pass a string, that string indeed needs to be vectorized to be used for vector similarity search.

So, think of it like this: if you take “Merc” and vectorize it elsewhere matching the same length of your vectors in the vector space in the DB, then take those floating numbers and pass them into a near\_vector search, it will work as if you do near\_text() because you’ve provided the vectors of that string.

Does that make sense?
