# Using Sketchfab API to search and download glTF (to be integrated in Castle Game Engine)

**URL:** https://forum.castle-engine.io/t/using-sketchfab-api-to-search-and-download-gltf-to-be-integrated-in-castle-game-engine/816
**Category:** News
**Created:** [May 26, 2023, 12:25pm UTC](https://forum.castle-engine.io/t/using-sketchfab-api-to-search-and-download-gltf-to-be-integrated-in-castle-game-engine/816 "2023-05-26T12:25:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [May 26, 2023, 12:25pm UTC](https://forum.castle-engine.io/t/using-sketchfab-api-to-search-and-download-gltf-to-be-integrated-in-castle-game-engine/816/1 "2023-05-26T12:25:05Z")

</div>

| [![Knight glTF model from https://sketchfab.com/3d-models/chunky-knight-f1722ab650ad4d8dbe6fc4bf44e33d38 by thanhtp](https://forum.castle-engine.io/uploads/default/original/2X/e/e0b497aee7406c43fd2d7d5e3d0d28bdee149cc0.png)](https://castle-engine.io/wp/wp-content/uploads/2023/05/sketchfab_knight.png "Knight glTF model from https://sketchfab.com/3d-models/chunky-knight-f1722ab650ad4d8dbe6fc4bf44e33d38 by thanhtp") |
| [![Cthulhu model from https://sketchfab.com/3d-models/flying-cthulhu-4737a3b84e00415b9d8bb42ae44285b2 by TooManyDemons](https://forum.castle-engine.io/uploads/default/original/2X/d/d0fc2e53ffbed08ab377ebf133b375f346965ff1.png)](https://castle-engine.io/wp/wp-content/uploads/2023/05/cthulhu_view3dscene.png "Cthulhu model from https://sketchfab.com/3d-models/flying-cthulhu-4737a3b84e00415b9d8bb42ae44285b2 by TooManyDemons") |
| [![Cthulhu model from https://sketchfab.com/3d-models/flying-cthulhu-4737a3b84e00415b9d8bb42ae44285b2 by TooManyDemons](https://forum.castle-engine.io/uploads/default/original/2X/d/db054dce98f78c55a4640df64cc002b4b965483e.png)](https://castle-engine.io/wp/wp-content/uploads/2023/05/cthulhu_sketchfab.png "Cthulhu model from https://sketchfab.com/3d-models/flying-cthulhu-4737a3b84e00415b9d8bb42ae44285b2 by TooManyDemons") |
| [![Apple model from https://sketchfab.com/3d-models/apple-macintosh-608e0f6ce5e9487eb859f48248e1fac4 by tzeshi](https://forum.castle-engine.io/uploads/default/original/2X/5/5be622bc64f9f435bafb859700f8180f0e75a5f0.png)](https://castle-engine.io/wp/wp-content/uploads/2023/05/sketchfab_apple.png "Apple model from https://sketchfab.com/3d-models/apple-macintosh-608e0f6ce5e9487eb859f48248e1fac4 by tzeshi") |

This was super-fun and super-quick to develop (thanks to GitHub Copilot) 🙂

I present a sample application that [searches Sketchfab and downloads glTF model matching given query string](https://github.com/michaliskambi/sketchfab-pascal-tests). For extra effect, it even opens the model with [view3dscene](https://castle-engine.io/view3dscene.php) if it is present on `$PATH`.

By default it looks for `cthutlhu` and happily downloads the first result, extracting the ZIP and running view3dscene. From nothing -\> Cthulhu 3D model!

Run with some command-line parameter to change the search string, to anything.

The code contains a simple class that downloads from Sketchfab. If you want, you can easily tweak it to download a particular model instead of the first search result. Read the “Usage” description for details.
