# Extracting class names from yolov8 model

**URL:** <https://discuss.roboflow.com/t/extracting-class-names-from-yolov8-model/2307>\
**Category:** 🤝  Community Help\
**Created:** [May 31, 2023, 5:22pm UTC](https://discuss.roboflow.com/t/extracting-class-names-from-yolov8-model/2307 "2023-05-31T17:22:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![민주\_맹](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/%EB%AF%BC%EC%A3%BC_%EB%A7%B9/32/2027_2.png) [@민주\_맹](https://discuss.roboflow.com/u/%EB%AF%BC%EC%A3%BC_%EB%A7%B9)\
**Post date:** [May 31, 2023, 5:22pm UTC](https://discuss.roboflow.com/t/extracting-class-names-from-yolov8-model/2307/1 "2023-05-31T17:22:04Z")

</div>

Hi, I just made a yolo model using roboflow,

and i want to extract the name of the class after object-detection in String on python.

But i cannot find the python api of roboflow

does anyone knows how or where can i look up?

I am using the tutorial python code so it looks like this

> from roboflow import Roboflow
> 
> rf = Roboflow(api\_key=“API”)
> 
> project = rf.workspace().project(“checkpoint”)
> 
> model = project.version(8).model
> 
> prediction = model.predict(“img.jpg”, confidence=40, overlap=30).json()](https://)

---

<div class="post-metadata">

**Author:** ![Christian\_Doms](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/christian_doms/32/2042_2.png) [@Christian\_Doms](https://discuss.roboflow.com/u/Christian_Doms)\
**Post date:** [May 31, 2023, 6:31pm UTC](https://discuss.roboflow.com/t/extracting-class-names-from-yolov8-model/2307/2 "2023-05-31T18:31:47Z")

</div>

> class\_index = `results.boxes.cls[i].item()`

where ‘i’ is one of the detected objects will give you the id corresponding to your class names
