Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8381423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:41:48+00:00 2026-06-09T16:41:48+00:00

For a URL I am trying to count it’s tweets through this API request:

  • 0

For a URL I am trying to count it’s tweets through this API request:

http://urls.api.twitter.com/1/urls/count.json?url=http://www.bbc.co.uk

This (in a Browser) returns the following Json:

{"count":216743,"url":"http:\/\/www.bbc.co.uk\/"}

I can manually parse the response:

$tweets = json_decode('{"count":216743,"url":"http:\/\/www.bbc.co.uk\/"}');
$this->set('tweets', $tweets->{'count'});

When I enter the URL instead of the Json, it doesn’t request any data. How would I get the following to work?

$tweets = json_decode('http://urls.api.twitter.com/1/urls/count.json?url=http://www.bbc.co.uk');
$this->set('tweets', $tweets->{'count'});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:41:50+00:00Added an answer on June 9, 2026 at 4:41 pm

    json_decode expects to get a JSON string. http://urls.api.twitter.com/1/urls/count.json?url=http://www.bbc.co.uk is not a JSON string, it’s a URL. json_decode does not fetch URLs. You need to fetch the URL yourself, then pass the result to json_decode:

    $json = file_get_contents('http://urls.api.twitter.com/1/urls/count.json?url=http://www.bbc.co.uk');
    $tweets = json_decode($json);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following url to stream twitter data. http://stream.twitter.com/1/statuses/filter.json?count=-150&follow=16256661&track=indiana Without the count
I am trying to parse following string... IN.Tags.Share({count:180,url:http://domain.org} is my following approach correct to
I'm trying to URL encode a string to form a GET request from objective-c.
I am trying to have a URL that would look like: mysite.com/@username Which would
Im trying to create a web service which gets to a URL e.g. www.domain.co.uk/prices.csv
I'm trying to call the Google URL Shortener API in my python code: def
I have been trying to fetch facebook like count of any web url. for
I'm trying to display the follow count of a twitter account, but when I
I'm trying to use this script (which extracts the domain from a URL): CREATE
I'm trying to count the number of hits for a particular URL on our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.