# What is the equivalent of ghost.url.api in API V2?

**URL:** <https://forum.ghost.org/t/what-is-the-equivalent-of-ghost-url-api-in-api-v2/5167>\
**Category:** Developer help\
**Created:** [January 20, 2019, 8:37pm UTC](https://forum.ghost.org/t/what-is-the-equivalent-of-ghost-url-api-in-api-v2/5167 "2019-01-20T20:37:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GBJsolution](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/gbjsolution/32/4738_2.png) [@GBJsolution](https://forum.ghost.org/u/GBJsolution)\
**Post date:** [January 20, 2019, 8:37pm UTC](https://forum.ghost.org/t/what-is-the-equivalent-of-ghost-url-api-in-api-v2/5167/1 "2019-01-20T20:37:27Z")

</div>

In API Version 0.1 there was an JavaScript helper function `ghost.url.api` using which we ware able to fetch the data internally in the theme. There was no requirement of authentication.

What is the equivalent way to in API V2. I want to fetch all post within my theme’s JavaScript file using ajax.

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [January 21, 2019, 7:54am UTC](https://forum.ghost.org/t/what-is-the-equivalent-of-ghost-url-api-in-api-v2/5167/2 "2019-01-21T07:54:36Z")

</div>

Content API SDK docs are here:

[https://docs.ghost.org/api/javascript/](https://docs.ghost.org/api/javascript/)

With full docs for the Content API here:

> **[Ghost Content API Documentation](https://ghost.org/docs/content-api/)**
>
> Ghost's RESTful Content API delivers published content to the world and can be accessed by any client to render a website. Read more on Ghost Docs.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [February 4, 2019, 7:54am UTC](https://forum.ghost.org/t/what-is-the-equivalent-of-ghost-url-api-in-api-v2/5167/3 "2019-02-04T07:54:41Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
