Title: Include variable in JSON block&#8217;s API URL
Last modified: April 26, 2024

---

# Include variable in JSON block’s API URL

 *  Resolved [jedlin](https://wordpress.org/support/users/jedlin/)
 * (@jedlin)
 * [2 years ago](https://wordpress.org/support/topic/include-variable-in-json-blocks-api-url/)
 * Can I adjust the API URL used by the JSON Content Gutenberg block in response
   to variable passed in the containing page’s URL? Example use case:
   — a page at
   URL /states has a JSON Content Gutenberg block that calls an API to request a
   list of US state names (e.g. api.com/states/all)— the block displays each returned
   state name as a clickable link having URL like /cities?state=ca — JSON Content
   Gutenberg block on /cities page calls api with request for cities in the selected
   state (e.g. api.com/[state]/cities/all)In other words, would I need 50 pages 
   with blocks having hard-coded API URLs, or can I have one page where the block’s
   API URL incorporates a passed variable?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [2 years ago](https://wordpress.org/support/topic/include-variable-in-json-blocks-api-url/#post-17716821)
 * Hi [@jedlin](https://wordpress.org/support/users/jedlin/),
 * thank you for asking.
 * The free JCI Plugin is not able to use GET- or POST-Parameters. Therefore the
   JCI Block just ignores state=ca
   Sorry about that,Bernhard
 *  Thread Starter [jedlin](https://wordpress.org/support/users/jedlin/)
 * (@jedlin)
 * [2 years ago](https://wordpress.org/support/topic/include-variable-in-json-blocks-api-url/#post-17716937)
 * Thanks for your quick answer. Since you qualified your answer to the free version,
   I guess the implication is that the paid version might do what I want. So I’ll
   give that a try.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Include variable in JSON block’s API URL’ is closed to new replies.

 * ![](https://ps.w.org/json-content-importer/assets/icon-256x256.png?rev=3464653)
 * [Get Use APIs - JSON Content Importer](https://wordpress.org/plugins/json-content-importer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-content-importer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-content-importer/)
 * [Active Topics](https://wordpress.org/support/plugin/json-content-importer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-content-importer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-content-importer/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [jedlin](https://wordpress.org/support/users/jedlin/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/include-variable-in-json-blocks-api-url/#post-17716937)
 * Status: resolved