How would I be able to get data from another website and put it on my own website? Website A has profiles of users along with other stuff. I want to be able to get the data of the user and incorporate it in my site.

  • 2
    So you want to steal the content from another website? – John Conde May 4 '11 at 12:06
  • @john, @jay - So you want to answer John's question? Am I really going to get downvoted for a helpful answer because you're doing something less-than-reputable? What's the deal? – jmort253 May 7 '11 at 1:50
  • 1
    @jmort253: +1 to your answer from me ... To the others: what's the purpose of (eg) Stack Apps, located at stackapps.com ? Is using any of that stealing? – Pierre.Vriens Jun 5 '15 at 13:26

To get data from another website, you can use a RESTful approach by using the same protocols a human user would use in order for two machines to communicate.

The beautiful thing about URLs is that machines can use them too!

Since you've used the PHP tag, I'm assuming PHP is your server-side language of choice. The PHP cURL function will allow your server-side portion of your website to make HTTP GET and POST requests to a specific URL to get the data that URL represents. Once you have that data, you can then parse that data, store it, display it, or do whatever you want to do with that data.

This involves programming, and also depends on the specific type of data that you're trying to obtain; therefore, please review the cURL reference for more detailed examples that will help get you started on solving this problem.

Once you have more specific questions, with code examples, please post them on Stack Overflow.

  • 2
    You shouldn't encourage others to steal content. It might be your content they want to steal. – John Conde May 4 '11 at 12:11
  • 1
    @John - I assumed the person asking the question is asking this for legitimate reasons. There are plenty of RESTful API's out there and creative commons content to be consumed. I didn't answer this question with this in mind that someone would use this information in a less-than-reputable manner. If I were to not answer a programming question just because I thought someone might do something malicious with the information, then I'd have 0 reputation on the SE network. Plus, you can steal my content, but you're probably not going to provide the level of service that built my business. – jmort253 May 5 '11 at 4:35
  • 1
    There are plenty of uses for this info that don't involve stealing information. I have a page that displays a weather report pulled from a public government page. Totally legit usage, but they don't provide it in a neat data format so I'm forced to grab the HTML and parse out the one paragraph manually – Stephen R Feb 11 '20 at 18:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.